I wrote a routine to hide columns and reorder. Here it is:
Public Shared Sub ShowCols(ByRef band As UltraGridBand, ByVal colsToShow() As String, _
ByVal cellActivation As Activation)
Dim Col As UltraGridColumn
Dim Position As Integer
Dim ColKey As String
Dim Count As Integer
' Hide all columns except ones in colsToShow.
For Each Col In band.Columns
Position = Array.IndexOf(colsToShow, Col.Key)
If Position = -1 Then
Col.Hidden = True
Else
Col.CellActivation = cellActivation
End If
Next
' Change column position to match the same as colsToShow.
Try
For Each ColKey In colsToShow
band.Columns(ColKey).Header.VisiblePosition = Count
Count += 1
Next
Catch ex As Exception
End Try
End Sub
You call it like this:
Dim Cols() As String = {"GradeLevel", "InitialSound", "LetterNaming", "PhonemicSegmentation", "NonsenseWord", "OralReading"}
uiHelper.ShowCols(grdDibels.DisplayLayout.Bands(0), Cols, Infragistics.Win.UltraWinGrid.Activation.ActivateOnly)
The Cols array is the columns you want to display arranged in the order you want them.
HTH
Fishy