I have implemented a WinGrid where I give the user the opportunity to save the layout at any point.
MemoryStream XMLStore = new MemoryStream();
System.Text.
UTF8Encoding enc = new System.Text.UTF8Encoding();
this.dgQueryResult.DisplayLayout.SaveAsXml(XMLStore);
To this point, I haven't used the overloaded method that specifies PropertyCategories, so I assume that all of the categories are being saved.
I have also implemented Formula Conditions that can be configured by the user and applied to the grid:
cva = (
ConditionValueAppearance)this.dgQueryResult.DisplayLayout.Bands[0].Columns[ColName].ValueBasedAppearance;
if (cva == null) cva = new ConditionValueAppearance();
cva.Add(condition, app);
this.dgQueryResult.DisplayLayout.Bands[0].Columns[ColName].ValueBasedAppearance = cva;
My problem is that, currently, my code is both applying the previously-saved layout and applying the FormulaCondition. This means that the grid has the conditions specified twice and every time the user saves the layout, those conditions multiply and the layout size grows very quickly.
While it would be easy enough to avoid applying new conditions if a layout has been applied, I would prefer to keep the formula conditions out of the layout.
I see the values for PropertyCategories, but which one includes the FormulaCondition settings and what else would I lose if I take it out of the SaveAsXML method?
Is there a white paper describing the various parts of the layout and which categories cover which parts?
Yeah, I did figure that it didn't de-serialize the layout with ValueBasedAppearance saved , without an exception. So, I ended up upgrading it to 10.2
Thanks.
Hi,
Just for future reference, you can attach files to your forum posts using the Options tab.
Anyway, I ran your sample and it works fine for me. But I had to update it to use v9.2, which is the oldest supported version.
I recommend that you update to the latest service release and see if that helps.
How to get the latest service release - Infragistics Community
The project is shared here.
http://community.infragistics.com/members/vivekmsi/files/InfragisticsDemo.zip.aspx
1) clicking load data will give you random data in the grid -- the conditional formatting is applied in initializeLayout and works perfectly
2) Save Layout will save it to a local xml file
3) When you try to reload this layout with the Load Layout button, it crashes.
Taking the Conditional formatting part out, the problem goes away.
I have a small sample app. How do i submit it to you?
I have a class level variable negCVA defined as below:
negCVA = new ConditionValueAppearance();
negCVA.Add(new OperatorCondition(ConditionOperator.LessThan, 0),new Infragistics.Win.Appearance { ForeColor = Color.Red });
In my InitializeLayout I am setting the ValueBasedAppearance = negCVA on some columns.
That part works perfectly fine.
However, when i try to save the layout after this has finished, and then reload this layout -- infragistics throws an exception during deserializing. What could cause having ValueBasedAppearance saving in the layout error out? Anything thats a know problem/methodology?
Let me know if this doesn't tell you enough -- I will send you a sample app or the XML which it is trying to load the layout from and what exception i get?