I would like to store different RadGrids' settings in one storage provider key file per user. i.e. all settings throughout the application for a user would be in one file. I am using the custom grid settings provider as per your demo and using the loadcustomsettings and savecustomsettings events to manage the custom settings. However when I add a setting for a grid it overwrites the entire file deleting any other settings that are added from other pages. I was hoping that using customsettings.add would just add/update that setting and leave the others alone. i.e. it would only affect the controlsetting with the provided name.
Here is the code I have for the persistence events. The same code exists on all the pages that have grids except the name when adding the settings is different (e.g. clinics, users, patients etc).
Here is the code I have for the persistence events. The same code exists on all the pages that have grids except the name when adding the settings is different (e.g. clinics, users, patients etc).
void PersistManager_LoadCustomSettings(object sender, PersistenceManagerLoadStateEventArgs e)
{
GridSettingsPersister loadPersister = new GridSettingsPersister(RadGrid1);
string settings = (string)e.CustomSettings.ControlSettings[0].Value;
loadPersister.LoadSettings(settings);
RadGrid1.Rebind();
}
void PersistManager_SaveCustomSettings(object sender, PersistenceManagerSaveStateEventArgs e)
{
GridSettingsPersister savePersister = new GridSettingsPersister(RadGrid1);
e.CustomSettings.Add(new Telerik.Web.UI.ControlSetting() { Name = "clinics", Value = savePersister.SaveSettings() });
}