GridBandCollection.MoveTo(Int32, GridBand) Method
Moves a band to a new position among other bands.
public virtual void MoveTo( int newIndex, GridBand band )
Public Overridable Sub MoveTo( newIndex As Integer, band As GridBand )
An integer value representing a new position of a band within the collection.
A GridBand object representing the band to be moved.
If the newIndex parameter exceeds the number of elements in the collection, the band is moved to the end of the collection. If the parameter value is negative, the band is removed.
Calling the MoveTo method is not in effect in the following cases:
- the band doesn't belong to the collection;
- the newIndex parameter matches the index of the specified band.
When you move a band forward (i.e., when the newIndex is higher than the current index), the band is actually moved to the position specified by the newIndex - 1 value. When you move a band backward, the band is moved to the position specified by the newIndex value.
The following code moves a GridBand1 to the position after a GridBand3.