' Let's assume that the following columns start in the following
' visible positions
gridControl1.Columns( 0 ).VisibleIndex = 0
gridControl1.Columns( 1 ).VisibleIndex = 1
gridControl1.Columns( 2 ).VisibleIndex = 2
gridControl1.Columns( 3 ).VisibleIndex = 3
' Set the visible position of the 1st and
' second columns between calls to the BeginInit
' and EndInit methods
gridControl1.BeginInit()
gridControl1.Columns( 0 ).VisibleIndex = 2
gridControl1.Columns( 1 ).VisibleIndex = 3
' At this point, the columns have the following visible indexes:
' Column( 0 ) -> 2
' Column( 1 ) -> 3
' Column( 2 ) -> 2
' Column( 3 ) -> 3
' Since the first and third columns, as well as the second and fourth columns,
' have the same visible indexes, the physical index of the columns with the same
' visible index will determine which column is displayed first.
gridControl1.EndInit()
' As a result, the columns would then possess
' the following visible positions.
gridControl1.Columns( 0 ).VisibleIndex = 0
gridControl1.Columns( 1 ).VisibleIndex = 2
gridControl1.Columns( 2 ).VisibleIndex = 1
gridControl1.Columns( 3 ).VisibleIndex = 3
' If the visible positions of the columns would
' have been changed outside of calls to BeginInit and
' EndInit, the result would have been:
gridControl1.Columns( 0 ).VisibleIndex = 2
gridControl1.Columns( 1 ).VisibleIndex = 0
gridControl1.Columns( 2 ).VisibleIndex = 3
gridControl1.Columns( 3 ).VisibleIndex = 1