Saving GridView State

Saving GridView State

Old forum URL: forums.lhotka.net/forums/t/5379.aspx


mushroom posted on Wednesday, September 10, 2008

Hi all,

I have been using a code to save a gridview's control state when paging. An example is, a list of IDs that was selected through checkboxes. I have been using the same running code on all my projects. But with, binding a GridView to a dataset.

My problem is when I implemented the code with binding a GridView to a CslaDataSource. Where I save the "selected IDs" is in the PageIndexChanging event. But, I noticed that, after clicking a page number, the SelectObject event fires first before the PageIndexChanging event. My problem with this behavior is that my GridView.Rows.Count is zero. Meaning that, I cant' get the selected/checked IDs, before the GridView changes the page.

Copyright (c) Marimer LLC