Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
675
Property Categories in WinGrid Layout for Formula Condition
posted

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?