I am using an UltraGrid control from Infragistics. I am able to get a strongly typed enumeration of the UltraGridColumns using the below code:

(this.grid.DisplayLayout.Bands[0].Columns).Cast<UltraGridColumn>();

How can I order this enumeration such that it is the same as in the UI? (The user is able to rearrange columns freely).

Is there a property that I can use to order by or use to sort on?

有帮助吗?

解决方案

The order is in the headers (yeah...):

this.grid.DisplayLayout.Bands[0].Columns).Cast<UltraGridColumn>()
    .OrderBy(c => c.Header.VisiblePosition);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top