|
# Form1.cs
private void buttonAdv1_Click(object sender, EventArgs e)
{
SaveFileDialog sfv = new SaveFileDialog();
sfv.FileName = "Sample";
sfv.DefaultExt = ".xml";
sfv.Filter = "(*.xml)|*.xml";
if (sfv.ShowDialog() == DialogResult.OK)
{
using (var sw = new StreamWriter(sfv.FileName))
{
SerializationController serializationController = new SerializationController(this.pivotGridControl1);
serializationController.Serialize(sw.BaseStream, serialization());
}
}
}
private void buttonAdv2_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.DefaultExt = ".xml";
ofd.Filter = "(*.xml)|*.xml";
if (ofd.ShowDialog() == DialogResult.OK)
{
using (var sw = new StreamReader(ofd.FileName))
{
SerializationController serializationController = new SerializationController(this.pivotGridControl1);
serializationController.Deserialize(sw.BaseStream, deserialization());
}
}
} |
|
S.No |
Query |
Response |
|
1 |
The problem is that when the Deserialize method is called more than once in the loop the pivotgrid freezes |
We have checked your requirment–“Pivotgrid is freezed while calling the deserialize method for multiple controls.” But we are unable to reproduce the reported issue in our application.
We have tried more possibilities to reproduce the reported issue by preparing sample with number of PivotGrid controls. We have tried to serialize/ deserialize the application as you mentioned and everything is working as expected.
Please find our working sample from the following location:
If the issue is still persists in your side, could you please modify the attached sample to reproduce the reported issue, so that it would be helpful to provide the prompt solution at the earliest.
|
|
2 |
Also, is there a better way to implement a filter from one xml file into another or simply have the filter fields remain when the rest of the fields are deserialized, effectively filtering all reports that come out of the pivot grid? |
As per the default behavior, you can deserialize the saved state of a specific report alone. i.e., When you are deserializing any existing file, your control will be modified based on the provided .xml file and you can’t maintain the states of any existing fields of your control. It is not a proper approach and it breaks the consistency of serialization.
The filter fields are not maintained while deserializing from another xml file. Only the fields are maintained if the serialized .xml file contains filter items.
|