New to Telerik UI for WinForms? Start a free 30-day trial
Save/Load Layout
Updated over 6 months ago
RadLayoutControl allows layout changes at runtime. To preserve the changed layout you can use the predefined SaveLayout and LoadLayout methods. Both methods can take path, stream or XmlWriter as parameters. The following example demonstrates the functionality:
Save Layout
C#
private void SaveButton_Click(object sender, EventArgs e)
{
string s = "default.xml";
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
dialog.Title = "Select a xml file";
if (dialog.ShowDialog() == DialogResult.OK)
{
s = dialog.FileName;
}
this.radLayoutControl1.SaveLayout(s);
}
Load Layout
C#
private void LoadButton_Click(object sender, EventArgs e)
{
string s = "default.xml";
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
dialog.Title = "Select a xml file";
if (dialog.ShowDialog() == DialogResult.OK)
{
s = dialog.FileName;
}
this.radLayoutControl1.LoadLayout(s);
}
The layout can be saved/loaded with the customize dialog as well.