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

Saving RadGrid PagerStyle settings

3 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 05 Sep 2008, 08:09 PM
Is it possible to catch, save, and later initialize PagerStyle settings according to the user's last-used settings?  I.e., if I have

                        <PagerStyle Mode="NextPrevNumericAndAdvanced" Font-Bold="False" Font-Italic="False" 
                            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" 
                            AlwaysVisible="true" /> 


and my user sets a page size of 50 (my default is 10) can I "learn" that they changed the value, save it in a user-preferences table, and when they come back later, initialize the control with those settings?

If not, is there a "save this control's value on this .aspx page for the life of the session"?

Thanks,
Tim

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Sep 2008, 05:01 AM
Hi Tim,

Check out the help document link on the same. You try the same logic to save the grid settings for each user.

http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html

Thanks,
Princy




0
Tim
Top achievements
Rank 1
answered on 08 Sep 2008, 01:57 PM
Thanks.  I figured out I can get call backs via ItemCommand for the Pager.  The help link above doesn't retrieve or serialize the Pager.  I spent 10 minutes searching for the answer when perhaps I should have spent 10 minutes reading.  Blame it on Google I guess ;)

Tim

0
Tim
Top achievements
Rank 1
answered on 08 Sep 2008, 09:16 PM
I have two follow-on questions.  First let me say that the changing of the page size on RadGrid X should affect the page size on Y and Z as well.  The presumption is the user has a big monitor or likes to see "lots of results" or "all results", rather than just a few.

1) In my ItemCommand handler for X, I can change the global default value.  On a new Page_Load (where postback == false) the newly-loaded page correctly inherits the global default.  However, a RadGrid on another tab on the same page does not get a new value even when I explicitly set it in the ItemCommand handler.  How can I change the value without going through Page_Init?

2) If that other RadGrid on the other tab itself has an ItemCommand, it gets called.  To keep things in sync, it then attempts to change the page size of the first tab's RadGrid, which results in an infinite loop.  Is there a way to change this property without causing the ItemCommand to be fired?  If not, what is the recommended mechanism for preventing the infinite loop?  All I can think of so far is some thread-local variable that says I'm already in the notification process and don't propagate it any further.

Thanks,
Tim

Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Tim
Top achievements
Rank 1
Share this question
or