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

How to save end-user customization

6 Answers 108 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Franco
Top achievements
Rank 1
Franco asked on 23 Nov 2010, 04:02 PM
Good evening.
    I want to know if there's a way to save the end-user customization of a CommandBar Control. If the user removes a button, or change the disposition of the strips... when he closes the application, next time he wants to find the layout as it was. I didn't find a method to do this.

Thank you.
Franco

6 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 04:48 PM
Hello Franco,

I haven't tried this feature yet, but it looks very useful. The RadCommandBar has a CommandBarElement, and from this, just like the RadGridView you can save and load a layout to a file.

For exmaple:
Me.RadCommandBar1.CommandBarElement.LoadLayout("FileName")
Me.RadCommandBar1.CommandBarElement.SaveLayout("FileName")

LoadLayout Documentation

hope this helps, but please let me know if you need further information

Richard
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 05:00 PM
Hello again,

i've just tried this and it works very well.
Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
    If My.Computer.FileSystem.FileExists("C:\Users\Richard\MyCommandBar.xml") Then
        Me.RadCommandBar1.CommandBarElement.LoadLayout("C:\Users\Richard\MyCommandBar.xml")
    End If
End Sub

Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
    Me.RadCommandBar1.CommandBarElement.SaveLayout("C:\Users\Richard\MyCommandBar.xml")
End Sub

Hope this helps
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 24 Nov 2010, 03:37 PM
Hi Franco,

How did you get on with this? If it helped, please mark as answer so others can find the solution too.
Regards,
Richard
0
Stefan
Telerik team
answered on 30 Nov 2010, 08:54 AM
Hi guys, 

Thank you for writing.

Richard's suggestion is the correct way of achieving the desired scenario. However, pretty soon we are going to upload a help article regarding this topic. 

Thank you Richard for your cooperation. If you guys need any additional assistance, do not hesitate to contact me.
 
Regards,
Stefan
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
0
Gabriele
Top achievements
Rank 1
answered on 07 Jul 2011, 03:14 PM
Hi,

I have the same issue and aftger triying to use the SaveLayout and LoadLayour methods, the commandbar is always in the default state, any change in the position of the commandbarrows is not memorized in the XML file.

Any suggestions?

Thanks,

-Gabriele
0
Gabriele
Top achievements
Rank 1
answered on 07 Jul 2011, 03:24 PM
Sorry, never mynd.

I did a mistake, not it works.

-Gabriele
Tags
CommandBar
Asked by
Franco
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Stefan
Telerik team
Gabriele
Top achievements
Rank 1
Share this question
or