Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Save the Control Layout to an XML File and Then Restore It

The following sample code demonstrates the way in which to save control layout to an XML file and then restore it. The NavBarControl.SaveToXml and NavBarControl.RestoreFromXml methods are used for this purpose.

The image below displays two NavBarControls before and after code execution. Note that the second control is initially empty (it doesn’t contain any groups and items). Layout information of the first control is saved to an XML file. The second control restores it. Note that only the layout of groups and links is saved.

SaveRestore

navBarControl1.SaveToXml("c:\\NavBarLayout.xml");
navBarControl2.RestoreFromXml("c:\\NavBarLayout.xml");