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

Save and Restore all the grid settings?

2 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Siva
Top achievements
Rank 1
Siva asked on 16 Apr 2010, 08:00 AM
I have a few grids, for which user can sort, filter, group and reorder columns. Also user can choose what are all columns he/she need to view in grid. All sort, filter, grouping and reordering are done by default, and i did visibility functionality by providing interface like add/remove columns, where user can choose hidden columns to show and visible columns to hide. After this selection i am setting IsVisible property of Grid.Columns in a loop.
Now I need to store all these settings per user basis in database and should load with the same state whenever he returns. Can I have any sample code to achieve this?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Apr 2010, 08:04 AM
Hello,

You can check this demo for more info.

All the best,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Siva
Top achievements
Rank 1
answered on 16 Apr 2010, 11:15 AM
Thanks for your quick reply!
But I have some data format strings associated with some of columns. so I have declared all the gridview columns as GridViewDataColumn. And initially some columns are hidden as per my logic. In your example you are using RadGridViewSettings object. How I can use this in my case to store the settings in Database. When I tried to serialize the settings object it is throwing exception as there is no default constructor for Class RadGridViewSettings.
Check the following exception message:
"Telerik.Settings.RadGridViewSettings cannot be serialized because it does not have a parameterless constructor."
How can i get the settings as xml string?

Tags
GridView
Asked by
Siva
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Siva
Top achievements
Rank 1
Share this question
or