saving & serializing RadGridView settings

8 posts, 0 answers
  1. Scott
    Scott avatar
    3 posts
    Member since:
    Aug 2012

    Posted 30 Aug 2012 Link to this post

    Hi,

    I am trying to save and serialize settings for my RadGridView, without much luck. I want to preserve sorting, grouping, filtering, and row selection. I have tried versions 2011.2.712.35 (what we used previously) and 2012.2.725.35 (the latest), and haven't had much luck generally. 

    What's the best way to do this? Can you supply an example?
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 31 Aug 2012 Link to this post

    Hi,

    You can go to http://demos.telerik.com/wpf/ and launch the demos, then in the search box in the top-right corner type "GridView Serialization" and you should get the example that shows how to save and restore properties using our Persistence Framework.

    All the best,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Scott
    Scott avatar
    3 posts
    Member since:
    Aug 2012

    Posted 12 Sep 2012 Link to this post

    Thanks!

    That seems to have solved my problem

    (...although I haven't yet figured out why restoring causes my first column to jump several columns to the right, get wider, and start displaying a header.)

    --Scott
  4. parthiv
    parthiv avatar
    7 posts
    Member since:
    Sep 2017

    Posted 23 Nov in reply to Scott Link to this post

    HI,

    I am new to Telerik ,I am using Radgridview R2 2107 version(2017.2.614.40) (WPF), I want to save gridview column position  and load again  when restart ,i have tries all examples which is posted but nothings worked for me... plz help

  5. parthiv
    parthiv avatar
    7 posts
    Member since:
    Sep 2017

    Posted 28 Nov in reply to parthiv Link to this post

    Hi,

    still waiting for the rply...plz help...

  6. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    61 posts

    Posted 28 Nov Link to this post

    Hello Parthiv,

    Saving RadGridView column position is implemented in the GridViewSerialization SDK example. The columns' DisplayIndex property is saved in the ColumnProxy's DisplayOrder property.
    Can you take a look at it and let me know if it works for you?

    Additionally, you can read some more about the approach used in that example in the CustomPropertyProviders article in our documentation.

    I am looking forward to your reply.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. parthiv
    parthiv avatar
    7 posts
    Member since:
    Sep 2017

    Posted 29 Nov in reply to Vladimir Stoyanov Link to this post

    Hi,

    Thx for reply, i have used your example which works only when application is running ,once we close and restart application column shows at the actual position ,it is not showing at the position where user has dropped, we are using Datatable to display data,example which you have given that is on sufficient for me.plz help

  8. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    61 posts

    Posted 04 Dec Link to this post

    Hello Parthiv,

    This is expected since the RadGridView layout is saved in a memory stream which is lost when the application is closed. In order to store the layout after closing the application, you can use the IsolatedStorage like so:
    private void Save(object sender, RoutedEventArgs e)
    {
     IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
     isoProvider.SaveToStorage();
    }

    Then in the Loaded event of the RadGridView, you can load the layout:
    private void gridView_Loaded(object sender, RoutedEventArgs e)
    {
    var isoProvider = new IsolatedStorageProvider();
    isoProvider.LoadFromStorage();
    }

    Another option is to save the memory stream in a file and then load it from there.

    I hope this helps. Don't hesitate to contact us again if you have any other questions.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top