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

TreeListBandCollection.Insert(Int32, TreeListBand) Method

Inserts the specified band to the specified position within the band collection.

Namespace: DevExpress.XtraTreeList.Columns

Assembly: DevExpress.XtraTreeList.v24.2.dll

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

#Declaration

public void Insert(
    int position,
    TreeListBand band
)

#Parameters

Name Type Description
position Int32

The zero-based index at which the specified band should be inserted.

band TreeListBand

An TreeListBand object to be inserted.

#Remarks

If the specified index is less than zero or is greater than or equal to the number of elements in the collection, an exception is raised.

You can also use the TreeListBandCollection.Add and TreeListBandCollection.AddBand methods to append individual bands, or the TreeListBandCollection.AddRange method to add several bands to the collection.

Bands cannot be added to the band collection in the following cases:

  • the band is the collection’s parent;
  • the collection already contains the specified band;
  • the collection’s owner is a child of the specified band (at any nesting level).
See Also