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

Pager custom control state persistance

4 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 24 Jul 2008, 05:39 PM
It seems a custom control state in <PagerTemplate> to be lost during postbacks. Is it behavour by desing?

4 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 24 Jul 2008, 07:44 PM
Can you show us an example how to reproduce this?
0
miksh
Top achievements
Rank 1
Iron
answered on 24 Jul 2008, 09:14 PM
1. In the example http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Programming/PagerTemplate/DefaultCS.aspx add a checkbox with checked=true
2. Uncheck it.
3. Change the page - the checkbox will be checked again, i.e. restores the original value.

All the pager controls in the example would restore the original values if you don't init them with the current grid values.
0
Pavel
Telerik team
answered on 28 Jul 2008, 11:21 AM
Hi miksh,

You cannot automatically persist the state of the control when you page the Grid, because it is rebound. You can see that it is working as you want it to when executing postbacks which do not rebind the Grid. The following help article which explains how to persist the CheckBox control state in GridTemplateColumn on rebind might be helpful for you. I think a similar approach can be used for a checkbox in the PagerTemplate as well.

Regards,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
miksh
Top achievements
Rank 1
Iron
answered on 28 Jul 2008, 04:16 PM
That makes sense, thanks.
Tags
Grid
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Vladimir
Top achievements
Rank 1
miksh
Top achievements
Rank 1
Iron
Pavel
Telerik team
Share this question
or