Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

#Declaration

public virtual void SetColumnPosition(
    TreeListColumn column,
    int rowIndex,
    int columnIndex
)

#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.

#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