Skip to content

Sortable Property

Description

Specifies whether the column can be sorted when the user clicks on the column header.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property Sortable() As Boolean

Remarks

If TRUE, records can be sorted by this column by clicking on the column header. Each time the column header is clicked, the sort order will toggle between ascending and descending. By default, Sortable is TRUE.

If FALSE, records cannot be sorted by this column by clicking on the column header. The column can still be sorted, but not by clicking on the column header. If you would like to sort the column when Sortable is FALSE, then you can add the column to the GridControl's SortOrder. This will allow you to keep a column sorted at all times.

Example

Disable Column Sorting by Clicking on the Column Header (Visual Basic)

This sample illustrates how to disable sorting by clicking on the column header.

' Add this to the General code section  
Const COLUMN_NAME = 1  

' This code is placed in the Form_Load event  
Dim Column As GridColumn  
Set Column = wndGridControl.Columns.Add(COLUMN_NAME, "Name", 300, True)  
' The user cannot sort the column by clicking on the column header  
Column.Sortable = False

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.