saving end-user customization (in c# preferably)

2 posts, 1 answers
  1. David T.
    David T. avatar
    4 posts
    Member since:
    Aug 2007

    Posted 18 Jun 2013 Link to this post

    I was wondering if there is a way to save end-user customizations of the commandBar.  For example,  commandBarRowElement1 and commandBarRowElement2 may be dragged to a different location in the toolbar area or a button may be added/removed.  This all works until i close the app and re-open it, the default layout/setting is loaded instead of the previous layout/settings.  i was hoping you could provide a link or example c# code for this. Thank you for your time in this matter. 
  2. Answer
    George
    Admin
    George avatar
    500 posts

    Posted 21 Jun 2013 Link to this post

    Hi David,

    Thank you for contacting us.

    You can referrer to this article Save and Load Layout | RadControls for WinForms Documentation. In addition, I prepared a short code snipped for you in case you want to save and load the layout when the application closes and loads.

    private const string LAYOUT_FILE = "layout.xml";
     
    private void Form1_Load(object sender, EventArgs e)
            {
                if (File.Exists(LAYOUT_FILE))
                {
                    this.radCommandBar1.CommandBarElement.LoadLayout(LAYOUT_FILE);
                }
            }
     
    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.radCommandBar1.CommandBarElement.SaveLayout(LAYOUT_FILE);
        }

    I hope I helped

    Regards, George
    Telerik
    RadChart for WinForms is obsolete. Now what?
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top