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

WPF RadGridView Persist User Settings Upon Application Exit

1 Answer 109 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Swiger
Top achievements
Rank 1
Brian Swiger asked on 26 Feb 2010, 03:12 PM
I've referred to the demo to persist user grid settings (sort orders, grouping, columns, etc.) and it works great!  Problem is...it only works when I load and unload the control where my grid is hosted.  How can I persist these grid settings when my application is closed (a user clicks the red X in the upper-right to close it down)?  Do you have an example of how to accomplish that...as I'm guessing I need some code in the Application.xaml file or its code-behind.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 01 Mar 2010, 07:53 AM
Hello Brian Swiger,

Our example for Save/Load settings shows how to save the settings when the Unloaded event the example is called but you are free to save the settings when the main windows is closing. For example, you can subscribe to the Closing event of the window, which will be called when the X button is clicked, and save the settings in the event handler:

<Window x:Class="RadGridView_WPF_2009_Q3_SP217.Window1"
    Title="Window1" Height="700" Width="600" Closing="Window_Closing">

private void Window_Closing(object sender, CancelEventArgs e)
{
    settings.SaveState();
}

Kind regards,
Milan
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.
Tags
GridView
Asked by
Brian Swiger
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or