0

I used following code to save and restore DevExpress PivotGridControl V7.2 layout:

//save layout
var fileName = string.Format(@"c:\pivot.xml");
pivotGridControl.SaveLayoutToXml(fileName);

//restore layout
var fileName = string.Format(@"c:\pivot.xml");
pivotGridControl.ForceInitialize();
pivotGridControl.RestoreLayoutFromXml(fileName);

But after running restore code, the layout doesn't change! Has my code any problem?

Masoud
  • 8,020
  • 12
  • 62
  • 123

2 Answers2

2

Thanks to Devexpress Support, following code, solved the problem:

pivotGridControl.OptionsLayout.Columns.RemoveOldColumns = false;

pivotGridControl.RetrieveFields();            
foreach (PivotGridField field in pivotGridControl.Fields) {
    field.Name = "field" + field.FieldName;
}
Masoud
  • 8,020
  • 12
  • 62
  • 123
1

I'm not familiar with devexpress enough. But I suggest if you did not get a good answer. You can ask the question as a Ticket in the devexpress support section Devxpress Support

Ahmad Javadi Nezhad
  • 527
  • 1
  • 5
  • 23