Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
390
How to get the selection when using filtering, paging and sorting
posted

I'm using the webdatagrid from version 2010 vol 3. The grid has filtering, sorting and paging enabled. When the page is postback, I always set the grid datasource from the Page_load with the data just in case any of the 3 features were used from the UI.

The problem with this is when the user select rows and hit a button, The WebDataGrid.Behaviors.Selection.SelectedRows.Count has the right count of selected rows, but all the row objects in the list are nulls. If I don't set the datasource in the page_load, they are not null. The problem is that if I don't set the datasource in the page load, the sorting, filtering and paging aren't working. I tried to set the datasource only in the "ed" events (filtered, sorted, etc.), but it's not working either.

For now, I'm thinking of copynig all selected rows in a temporary list to be able to access them later in the code. Any other ideas?

Any help would be greatly appreciated.