After setting the DataSource in code, I can hide or show columns, but how do I change the order of the columns? I found UltraGridBand.ColumnVisiblePositionComparer but can't figure out what it does or if it's what I need. Thanks in advance.
The Header.VisiblePosition it the right way to go. I would recommend using the InitializeLayout event of the combo (just as you would for the WinGrid) and so something like this:
e.Layout.Bands[0].Columns["Code"].Header.VisiblePosition = 0;
e.Layout.Bands[0].Columns["Description"].Header.VisiblePosition = 1;
This appears to work, but I'm not sure if it is the best way:
this.UltraCombo2.DisplayLayout.Bands[0].Columns["Description"].Header.VisiblePosition = this.UltraCombo2.DisplayLayout.Bands[0].Columns["Code"].Header.VisiblePosition - 1;
TIA for any feedback on this.
I tried:
this.UltraCombo1.DisplayLayout.Bands[0].Columns["Code"].Swap(this.UltraCombo1.DisplayLayout.Bands[0].Columns["Description"]);
but this results in an error: "Column swapping not supported".