New to Telerik UI for WinForms? Start a free 30-day trial
Save and Load Layout
Updated over 6 months ago
RadPivotGrid supports save and load layout functionality, which gives your applications the opportunity to preserve user RadPivotGrid settings such as group descriptors and restore them later. Those layout settings are written in a xml file.
Here is a sample demonstrating how you can implement a Save Layout button event handler.
SaveLayout
C#
private void radButtonSaveLayout_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.radPivotGrid1.SaveLayout(s);
}
The code snippet below demonstrates how you can implement a Load Layout button event handler.
LoadLayout
C#
private void radButtonLoadLayout_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.radPivotGrid1.LoadLayout(s);
}
This API should be used only if the data binding has been performed via the DataSource property or using a LocalSourceDataProvider. The API also does not export custom aggregate functions. For SAAS cubes and custom aggregation serialization please refer to: