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

Saving Grids Pager Page with GridSettingsPersister

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guss
Top achievements
Rank 2
Guss asked on 18 Sep 2008, 07:42 PM
Hi there

I've implimented the GridSettingsPersister code and kudus for the contributer. It is realy good code and give my app an additional edge.

On the same manner, I also save persistant database criteria for a user as well as pagesise etc.

For sharing
    protected void Page_Load(object sender, EventArgs e)  
    {  
        RadGrid grid1 = (RadGrid)this.ContentPlaceHolder.FindControl("RadGrid1");  
        if (grid1 != null)  
        {  
            String recordPerPage = Profile.ApplicationPreferences.RecordsPerPage;  
            Int32 pagesize;  
            bool isNum = Int32.TryParse(recordPerPage, out pagesize);  
            if (isNum)   
            {  
                grid1.PageSize = pagesize;  
            }  
        }  
    } 

For the grid I use the Persister Class.

Now I just short one more thing, and I can't get the hang around it.

I want to save the pagenumber (which page on the pager is active) als to the users profile.

gridSettings[6] = (object)gridInstance?????????? in SaveSetting

and 
this.gridInstance.????????= (string)gridSettings[6]

Any pointer will be welcome.
Guss

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Sep 2008, 01:45 PM
Hi Guss,

You can use CurrentPageIndex property to achieve this.

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Guss
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or