Is there a way to save the xml of an UltraGrid's appearance without saving the ValueLists? I want to save the order, size, visibility of the columns but not save the items in the ValueLists. I've looked at the PropertyCategories options that can be used in SaveAsXml(), but can't find the right combination for what I'm looking for. Any ideas?
Hi Brent,
You can exclude ValueLists from the layout by omitting the corresponding flag from PropertyCategories. So for example the PropertyCategories combination that you can use is something like
Infragistics.Win.UltraWinGrid.PropertyCategories.All & ! Infragistics.Win.UltraWinGrid.PropertyCategories.ValueLists
Please let me know if you have any questions.
Sincerely,
Sahaja Kokkalagadda
Associate Software Developer, Windows Forms
http://ko.infragistics.com/
Hello Sahaja,
Thanks for the suggestion. I tried doing that, but I get the error "Operator '!' cannot be applied to operand of type 'PropertyCategories'" My code is below. Any ideas?
grid.DisplayLayout.SaveAsXml(stream, PropertyCategories.All & !PropertyCategories.ValueLists);
There is no ‘!’ operator when using PropertyCatogories. I meant not to include ValueLists flag in the combination when I said ! ValueLists. I apologize for the confusion caused. To save multiple layout categories, those should be combined using logical “Or”.
You can use either Bands or Unbound Columns flag in PropertyCatogories to exclude ValueLists. Some categories implicitly include others. You can refer to the PropertyCatogories enum latest documentation at the below link to read more about the categories that are implicitly included.http://help.infragistics.com/Help/Doc/WinForms/2010.3/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v10.3~Infragistics.Win.UltraWinGrid.PropertyCategories.html
Sincerely,Sahaja KokkalagaddaAssociate Software Developer, Windows Formshttp://ko.infragistics.com/
To save everything except the ValueList's of the Grid column’s, you can do something like this.
grid.DisplayLayout.SaveAsXml(stream, PropertyCategories.All & ~PropertyCategories.ValueLists);
Please try this and let me know if you have any questions.