I have an ultragrid and at Runtime I am adding a new column to the grid with multiple bands.
To reflect this change I databind the grid. On databinding I loose the column widths of other columns. I want to avoid this. Please advice
Hi Krishna,
Thank you for contacting Infragistics Developer Support.
If you need to keep the column width after rebinding you can use the SaveAsXml and LoadFromXml methods of the grid’s display layout. You can read more about these method in the following links:
SaveAsXml:
http://help.infragistics.com/Doc/WinForms/2014.1/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v14.1~Infragistics.Win.UltraWinGrid.UltraGridLayout~SaveAsXml(String).html
LoadFromXml:
http://help.infragistics.com/Doc/WinForms/2014.1/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v14.1~Infragistics.Win.UltraWinGrid.UltraGridLayout~LoadFromXml(String).html
Please let me know if you have any additional questions.
I tried the SAVEASXML / LOADFROMXML method but this does not show the additional column that was added to the grid
Hello Krishna,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
New columns are show by default when loading a layout. If the column is not showing up, it must be because you have set NewColumnLoadStyle to Hide. So before you load the layout, try setting it to true:
this.ultraGrid1.DisplayLayout.NewColumnLoadStyle = NewColumnLoadStyle.Show;