You can save and load the layout of the grid through the DisplayLayout.Save (or SaveAsXml) and DisplayLayout.Load (or LoadFromXml) methods; these will take into account the column positions that the user has specified.
As for the issue with the column order, that seems to be a bug since it's not updated even when the ColumnDisplayOrder is set to SameAsGrid. You should report this to Developer Support. A quick hack workaround would be to listen to the grid's AfterColPosChanged event and force the column choose to refresh, i.e.:
private void ultraGrid1_AfterColPosChanged(object sender, Infragistics.Win.UltraWinGrid.AfterColPosChangedEventArgs e){ if (e.PosChanged == Infragistics.Win.UltraWinGrid.PosChanged.Moved) { this.ultraGridColumnChooser1.ResetColumnDisplayOrder(); this.ultraGridColumnChooser1.ColumnDisplayOrder = Infragistics.Win.UltraWinGrid.ColumnDisplayOrder.SameAsGrid; }}
-Matt
Hi,
There's no way to separate the sorting from the column order. But you could load the layout and then remove the grouping and sorting.
// Load the layoutthis.ultraGrid1.DisplayLayout.LoadFromXml(filename, propertyCategories);// Clear all sorting and groupingthis.ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Clear();
Hello,
We just want to save/load the following :
1, visible columns (by the UltraGridColumnChooser)2, columns display sequence/order (by draging)
The group by columns should not be saved/reloaded.
Is it possbile to fulfill it? Any code demo will be appreciated.
Thanks