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

Example: TreeList.VisibleColumnCount, TreeList.VisibleColumns

The following sample code fills a string list with captions of the visible columns within the control. The GetVisibleColumnsList method uses the VisibleColumns and VisibleColumnCount properties to get access to the collection and to determine the number of visible columns within the collection.

Note that the AColumns parameter should be already initialized.

procedure GetVisibleColumnsList(AColumns: TStringList);
var
  I: Integer;
begin
  for I := 0 to cxTreeList.VisibleColumnCount - 1 do
    AColumns.AddObject(cxTreeList.VisibleColumns[I].Caption.Text, cxTreeList.VisibleColumns[I]);
end;