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

Exclude Page Settings in GridPersister Class

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dharmesh
Top achievements
Rank 1
Dharmesh asked on 19 May 2011, 12:11 PM
Hello All,

I have one small issue while Saving RadGrid Settings using GridPersister Class.
Actually I want to Save All supported "PersistedSettingTypes" but not Paging settings.
So any one have idea how to exclude only Page Settings while Saving Grid Settings?

Thanks in Advance & Regards,

Dharmesh

2 Answers, 1 is accepted

Sort by
0
Dharmesh
Top achievements
Rank 1
answered on 20 May 2011, 06:11 AM
Hello Everyone,

Any idea ?

Thanks & regards,
Dharmesh
0
Tsvetina
Telerik team
answered on 24 May 2011, 01:35 PM
Hello Dharmesh,

You just need to go through the code of the GridSettingsPersister class and comment out the Paging related lines:
public virtual GridSettingsCollection GetSavedSettings()
    {
        if (Grid == null)
        {
            throw new NullReferenceException();
        }
  
        if (IsSettingSpecified(GridSettingsType.Paging)) SavePagingSettings();
        if (IsSettingSpecified(GridSettingsType.Grouping)) SaveGroupByExpressions();
        if (IsSettingSpecified(GridSettingsType.Sorting)) SaveSortExpressions();
        if (IsSettingSpecified(GridSettingsType.Filtering)) SaveFilterExpression();
        if (IsSettingSpecified(GridSettingsType.ColumnSettings)) SaveColumnSettings();
  
        return Settings;
    }

protected virtual void SavePagingSettings()
{
    Settings.PageSize = Grid.MasterTableView.PageSize;
}

protected virtual void LoadPagingSettings()
{
    if (Grid.MasterTableView.AllowPaging && Settings.PageSize > 0)
    {
        Grid.MasterTableView.PageSize = Settings.PageSize;
    }
}
etc..

Kind regards,
Tsvetina
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
Dharmesh
Top achievements
Rank 1
Answers by
Dharmesh
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or