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

saving grid settings in wpf.

3 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sandy pochiraju
Top achievements
Rank 1
sandy pochiraju asked on 22 Sep 2009, 01:07 AM
hi all,
i recently started using telerik controls for wpf.

i wud like to save grid settings like column order, grouping, sorting etc.
i want to have a column chooser for my grid and save the columns users select along with other settings.

i wud like to save these settings in the database on a button click.

please can anyone let me know if this is possible in wpf and if yes then how.

thank u
sandy

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 22 Sep 2009, 12:24 PM
Hi sandy pochiraju,

Yes it is possible. If you look at the Save and Load of the RadGridViewSettings class you will see that the grid settings are saved to an loaded from a stream:

public void Save()  
{  
    using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())  
    {  
        using (IsolatedStorageFileStream stream = new   
            IsolatedStorageFileStream(PersistID, FileMode.Create, file))  
        {  
            serializer.WriteObject(stream, this);  
        }  
    }  
}  
 

There is no problem to write the serialized settings to a MemoryStream instead of FileStream and save this stream to a database. Similarly when you want to load the setting you should get the serialized stream from your database, create a memory stream from it and load the setings.

Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
sandy pochiraju
Top achievements
Rank 1
answered on 23 Sep 2009, 05:59 PM
hi Milan,

thanks so much for the reply. please can you tell me where to find RadGridViewSettings class. i am unable to find it.

regards,
Sandhya
0
Vlad
Telerik team
answered on 24 Sep 2009, 06:06 AM
Hi sandy,

You can check this blog post for more info:
http://blogs.telerik.com/vladimirenchev/posts/09-04-03/how_to_save_and_load_settings_with_radgridview_for_wpf.aspx

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
sandy pochiraju
Top achievements
Rank 1
Answers by
Milan
Telerik team
sandy pochiraju
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or