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

saving end-user customization (in c# preferably)

1 Answer 92 Views
Visual Studio Extensions
This is a migrated thread and some comments may be shown as answers.
David T.
Top achievements
Rank 1
David T. asked on 18 Jun 2013, 03:49 PM
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. 

1 Answer, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 21 Jun 2013, 03:24 PM
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?
Tags
Visual Studio Extensions
Asked by
David T.
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or