May 15, 2012 06:54 PM|c0pe|LINK
I have a gridView control, which uses a linqDatasource control. I'm using the linqDatasource's OnSelecting event to perform a custom linq to sql query for binding data to the control. I have the gridview setup to allow paging and sorting... this all worked
fine. Later I made the following change to the page:
This is a content page (has a masterPage), and the whole content page *was* wrapped in an UpdatePanel. I changed the page by splitting it up into two sections (think Master/Detail), each wrapped in it's own UpdatePanel, rather than everything being inside
the one updatePanel. Both updatePanels updateMode is set to 'conditional' and the 'ChildrenAsTriggers' is set to true. When the page was all in one updatePanel that updatePanel was set the same way.
Now, for some reason, sorting no longer works on my gridview? I can't figure out why?
I can make it work again by explicitly calling Update() on the updatePanel the gridView is inside from the OnSelecting event of the linqDatasource control but I don't know why I need to do that now, where I did not before? ChildrenAsTriggers is set to true,
so wouldn't clicking on the column header links in the gridview for sorting 'trigger' the update automatically?
could anyone shed some light on this?
The gridView that is no longer sorting automatically is in the first updatePanel, the second updatePanel also contains a gridview and it sorts fine? Really strange (until you know the answer)