J
J055
Hi
I'm adding a couple of features to the GridView control. I'm not sure how
best to get the total row count from the data source to use for displaying
page information in the pager rows. Something like this:
Records 5 to 10 of 25
I've got this working in the code behind page so now I want to move the code
to the new GridView class. The datasource could be anything but is likely to
come from a DataTable so I want a reliable count of these rows to use in the
class.
I've been doing this in the code behind but I'm sure there's a much neater
solution.
protected void ObjectDataSource_Selected(object sender,
ObjectDataSourceStatusEventArgs e)
{
//Response.Write(e.AffectedRows.ToString());
//Response.Write(e.ReturnValue.GetType().ToString());
DataTable dt = (DataTable)e.ReturnValue;
totalUsers = dt.Rows.Count;
}
Can anyone point we in the right direction? Is there any good reference
material I should be aware of.
Many thanks
Andrew
I'm adding a couple of features to the GridView control. I'm not sure how
best to get the total row count from the data source to use for displaying
page information in the pager rows. Something like this:
Records 5 to 10 of 25
I've got this working in the code behind page so now I want to move the code
to the new GridView class. The datasource could be anything but is likely to
come from a DataTable so I want a reliable count of these rows to use in the
class.
I've been doing this in the code behind but I'm sure there's a much neater
solution.
protected void ObjectDataSource_Selected(object sender,
ObjectDataSourceStatusEventArgs e)
{
//Response.Write(e.AffectedRows.ToString());
//Response.Write(e.ReturnValue.GetType().ToString());
DataTable dt = (DataTable)e.ReturnValue;
totalUsers = dt.Rows.Count;
}
Can anyone point we in the right direction? Is there any good reference
material I should be aware of.
Many thanks
Andrew