TreeList.SetColumnPosition(TreeListColumn, Int32, Int32) Method

Moves the specified column to the specified position among visible columns belonging to the same band.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll

Declaration

public virtual void SetColumnPosition(
    TreeListColumn column,
    int rowIndex,
    int columnIndex
)
Public Overridable Sub SetColumnPosition(
    column As TreeListColumn,
    rowIndex As Integer,
    columnIndex As Integer
)

Parameters

Name Type Description
column TreeListColumn

An object that specifies the column to be moved.

rowIndex Int32

The zero-based index of the row where the specified column should be moved. This value is assigned to the TreeListColumn.RowIndex property.

columnIndex Int32

The zero-based index of the column within a band row where the specified column should be moved. This value is assigned to the TreeListColumn.ColumnIndex property.

Remarks

The SetColumnPosition method is not in effect if the specified column has no parent band (see the TreeListColumn.ParentBand property).

If the rowIndex parameter exceeds the number of rows, the column is moved to the newly created row. If this parameter is negative, an exception is raised.

The column is added to the first position in the row's column collection if the colIndex parameter is less than 0. If the colIndex exceeds the number of columns displayed within a row, the specified column is added to the end of the row's column collection.

If the specified column is hidden (its TreeListColumn.Visible property is set to false), this method makes this column visible and after that, moves it.

See Also