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

TdxCustomShellListView.Folders Property

Provides indexed access to displayed shell items.

#Declaration

Delphi
property Folders[AIndex: Integer]: TcxShellFolder read;

#Property Value

Type Description
TcxShellFolder

A shell item (a file, folder, or shell item link).

Use the FolderCount property to obtain the number of shell items accessible through this property.

#Remarks

Use the Folders property to access individual displayed shell items.

#Code Example: Identify Selected Shell Items

The following code example displays the name and type of the first selected shell item in the application form caption:

var
  AFolder: TcxShellFolder;
begin
  if ((dxShellListView1.FolderCount = 0) or (dxShellListView1.SelectedItemCount = 0)) then Exit;
  AFolder := dxShellListView1.Folders[dxShellListView1.SelectedItems[0].Index];
  Caption := 'The ' + AFolder.DisplayName;
  if AFolder.IsFolder then
  begin
    Caption := Caption + ' folder is selected';
    if AFolder.SubFolders then
      Caption := Caption + '; includes nested folders';
  end
  else if((AFolder.IsLink) or (AFolder.IsFolderLink) or (AFolder.IsZipFolderLink)) then
    Caption := Caption + ' shell item link is selected'
  else
    Caption := Caption + ' file is selected';
end;
See Also