[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ShellCtrls' (#lcl)

# TCustomShellTreeView.FileSortType

Indicates the sort type used for items (tree nodes) on the tree view control.

## Declaration

Source position: shellctrls.pas line 140

`public property TCustomShellTreeView.FileSortType : TFileSortType read FFileSortType write SetFileSortType default fstNone;`

## Description

FileSortType is a TFileSortType property used to indicate the sort order for tree nodes in the Items property. The default value for the property is fstNone, and indicates the default sort order is used for tree nodes. See TFileSortType for information about the enumeration values and their meanings.

Changing the value in FileSortType causes the Items property to be cleared, and tree nodes to be reloaded using the sort order needed for the property value. If Root has not been assigned, PopulateWithBaseFiles is used to fill the Items property. If Root has a non-empty value, an internal routine is called to recreate the root node using the required path. The value in Root is expanded and used to create the remaining nodes for the tree. This includes filling TShellTreeNode-specific information for the TTreeNode instances in Items. If the path to the Selected tree node is still valid for the file system, it is restored to the Path property.

No action other than setting the property value is performed in the method at design-time.

The value in FileSortType is used in the PopulateTreeNodeWithFiles method and passed as an argument to an internal method used to load the files in a given path name.

Use the OnSortCompare event handler to implement the sort / compare routine needed when FileSortType is set to fstCustom.

Remark: | The value in FileSortType is not used in PopulateWithBaseFiles on Windows platforms. The entries are logical drive letters processed in the order provided by the file system.

## See also

TCustomShellTreeView.Items |  | Contains the tree nodes used to represent the hierarchical tree structure for the tree view control.
TCustomShellTreeView.Root |  | Indicates the directory or path which is the top-level node in the tree view.
TCustomShellTreeView.Path |  | Path to the directory displayed in the shell control.
TCustomShellTreeView.ExistsAndIsValid |  | Checks whether the specified path is a valid file system object and type for the tree view control.
TCustomShellTreeView.OnSortCompare |  | Event handler signalled to compare file items in a custom sort routine.
TCustomShellTreeView.PopulateWithBaseFiles |  | Fills the tree view when the Root directory is empty.
TCustomShellTreeView.PopulateTreeNodeWithFiles |  | Adds tree nodes for file system objects found starting at the specified node / path.
TFileSortType |  | Represents sorting options for the items in a shell control.
EInvalidPath |  | Exception raised for an invalid path in shell controls.