This is a migrated thread and some comments may be shown as answers.

radgridview pager problem with SEOPaging

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdellatif
Top achievements
Rank 1
Abdellatif asked on 09 Jan 2011, 04:49 PM
I used the Telerik.GridExamplesCSharp.Programming.SEOPaging namesapce to display the pager of radgridview to disable and enable the pager buttons according to current page index with out using custom paging "using NextPrevAndNumeric mode " but I faced a problem when adding a checkbox column to the grid as the checkbox column doesnt check the selected checkbox because the pager work with query string mechanism so the page is reloaded and lost the selected checkbox state ..
could u please help me asap...
thanks for ur effort

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 13 Jan 2011, 10:32 AM
Hi Abdellatif,

Even if you didn't use SEO paging, the checkboxes in a checkbox column would not persist its checked state if you page. This is because paging causes RadGrid to rebind (regular paging, not SEO paging). Rebinding recreates the entire grid structure. The next time you come back to the page in which you have modified the checkboxes, the checked state is not preserved. In effect, you cannot persist changes to input controls across pages. You need to save your changes programmatically and load them back upon arriving to the same page. You would be able to implement such a behavior based on your scenario with regular paging. However, with SEO paging, the grid does not postback at all when you page. It makes a GET request to show the next selected page, thus the page is always in its initial load stage (IsPostBack = false). Thus, you cannot save the checked state before navigating to another page. As a workaround, you need to enable AutoPostBack="true" for your checkboxes, and then, for each CheckedChanged event that fires, you need to save the Checked state of the checkBox along with the item index and current page index. Thus, the grid page, item and checkbox state uniquely identify a checkbox. You need to save this data into the Session (or some persistent media). Loading saved data can happen in the PreRender event of the grid or the page. You need to take all checked settings for the current grid page, find the checkboxes in your grid items and apply their checked state.

Veli
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Abdellatif
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or