Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Private Sub Button64_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button64.Click
' Get a band and a column.
Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(0)
Dim column As UltraGridColumn = band.Columns(0)
' Sort by that column.
band.SortedColumns.Clear()
band.SortedColumns.Add(column, False)
' Get a row.
Dim row As UltraGridRow = Me.ultraGrid1.Rows(0)
' Change the value of the cell associated with the column that the rows are
' sorted by.
row.Cells(column).Value = "Sweden"
' Get the index before calling the RefreshSortPosition.
Dim oldIndex As Integer = row.Index
row.RefreshSortPosition()
' Get the index after calling the RefreshSortPosition.
Dim newIndex As Integer = row.Index
' Show a message box with both indexes.
MessageBox.Show("Index before RefreshSortPosition = " & oldIndex & vbCrLf & _
"Index after RefreshSortPosition = " & newIndex)
End Sub