I have a RadGrid being populated in code by a DataTable (unsorted). I'm trying to create a custom pager in the grid that displays a DropDownList with some optional additional info.
If the user is sorting the Grid by Date, I'd like the pager to display the items like:
[Page 1 - 1-Jan-2010 to 17-Jan-2010]
[Page 2 - 17-Jan-2010 to 4-Feb-2010]
(etc)
I'm able to populate the pager, but the dates I retrieve back are the unsorted dates in my DataTable - not the ones sorted in the grid. I'm doing this in my pager (a custom Pager class that inherits Control) in the CreateChildControls method. I do this by iterating through the pages in the Grid's DataSource (as DataTable), and on each page I get the date for the first and last displayed rows.
Is there a way I can accomplish this and still let the Grid handle the sorting? I know an alternative would be to provide a DataView to the Grid as the DataSource (and then handle the sorting expressions manually), but it seems like there should be a better (less code) way of accessing this already-sorted data.
Thanks,
Stefan
If the user is sorting the Grid by Date, I'd like the pager to display the items like:
[Page 1 - 1-Jan-2010 to 17-Jan-2010]
[Page 2 - 17-Jan-2010 to 4-Feb-2010]
(etc)
I'm able to populate the pager, but the dates I retrieve back are the unsorted dates in my DataTable - not the ones sorted in the grid. I'm doing this in my pager (a custom Pager class that inherits Control) in the CreateChildControls method. I do this by iterating through the pages in the Grid's DataSource (as DataTable), and on each page I get the date for the first and last displayed rows.
Is there a way I can accomplish this and still let the Grid handle the sorting? I know an alternative would be to provide a DataView to the Grid as the DataSource (and then handle the sorting expressions manually), but it seems like there should be a better (less code) way of accessing this already-sorted data.
Thanks,
Stefan