Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView
Private Sub ultraListView1_ColumnMoving(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ColumnMovingEventArgs) Handles ultraListView1.ColumnMoving
' If the column about to be moved is the MainColumn, cancel
' the event to prevent the column from being moved.
If e.Column.GetType() Is GetType(UltraListViewMainColumn) Then e.Cancel = True
End Sub
Private Sub ultraListView1_ColumnMoved(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ColumnMovedEventArgs) Handles ultraListView1.ColumnMoved
Dim listView As UltraListView = CType(sender, UltraListView)
' If an UltraListViewSubItemColumn was moved to the leftmost
' visible position, move the MainColumn into the leftmost
' position instead, and move the column that was moved by
' the end user to the next position after that.
If e.Column.GetType() Is GetType(UltraListViewSubItemColumn) AndAlso _
e.Column.VisiblePositionInDetailsView = 0 Then
listView.MainColumn.VisiblePositionInDetailsView = 0
e.Column.VisiblePositionInDetailsView = 1
End If
End Sub