Skip to main content
A newer version of this page is available. .

RepositoryItemLookUpEdit.SortColumnIndex Property

Gets or sets the visible column index against which data is sorted.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(0)]
public int SortColumnIndex { get; set; }

Property Value

Type Default Description
Int32 0

The zero-based visible column index against which data is sorted.

Remarks

Data in the editor’s dropdown can be sorted against a single column and this is specified by the SortColumnIndex property. This property indicates the column’s visible index in the dropdown. The visible index of a specific column can be obtained via the LookUpColumnInfoCollection.VisibleIndexOf method of the RepositoryItemLookUpEdit.Columns object.

To apply sorting to a column the column’s sort order must be specified via the LookUpColumnInfo.SortOrder property. If it’s set to ColumnSortOrder.None data isn’t sorted. If it’s set to ColumnSortOrder.Ascending or ColumnSortOrder.Descending data is sorted in ascending or descending order.

To enable end-users to sort by columns by clicking their headers set the RepositoryItemLookUpEdit.HeaderClickMode property to HeaderClickMode.Sorting.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SortColumnIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also