How To: Save and load settings with RadGridView for Silverlight

Wednesday, April 08, 2009 by Vladimir Enchev | Comments 5

I’ve made another demo (similar to this one) on how to save and restore various RadGridView settings using IsolatedStorageFile and DataContractSerializer. Again to turn on this for your grid you can simply set RadGridViewSettings.IsEnabled attached property:

<
UserControl x:Class="SaveLoadSettingsWithRadGridViewForSilverlight.Page"
  
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
   
xmlns:ts="clr-namespace:Telerik.Settings">
    <
Gridx:Name="LayoutRoot"Background="White">
        <
telerik:RadGridView ts:RadGridViewSettings.IsEnabled="True" x:Name="RadGridView1" />
    </
Grid>
</
UserControl>

Saved settings are

  • Sorting
  • Grouping
  • Filtering
  • Frozen columns
  • Columns width and order

Enjoy!

[Download]

5 Comments

  • sandy 23 Sep
    hi Vladimir,

    i am unable to find reference to Telerik.Settings... is it not part of the release?
    i hv q2 2009 for wpf on my system.

    Please advice on how to get the reference for telerik.settings.

    regards,
    Sandy
  • Vlad 24 Sep
  • Mitch 17 Dec
    I cannot find a reference to Telerik.Settings either!

    How do we find this or has it now changed?

    Also, is it possible to remove columns from the Grid and save the layout with the columns removed so they do not appear when it's next loaded.

    Regards

    Mitch
  • Vlad 19 Dec
    Hi Mitch,

    You can check the latest version of this demo here:
    http://demos.telerik.com/silverlight/#GridView/SaveLoadSettings

    You can easily add save/restore which column(s) will be loaded and/or visible in RadGridViewSettings class.

    Vlad
  • Rodney 22 Feb
    Hello Vlad,

    I am confused - is the code built into the RadGridView or do we have to copy the RadGridViewSettings class from the example?

    Thanks

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)