ObjectDCL Banner

ListView_SortTextItems Method

Description

This method will sort the columns in ascending or descending order, based on the column index provided. This method will not keep track of which column was sorted as ascending or descending, this is up to you.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
nColIndex
Integer specifying column index.
bAscending
Integer specifying sorting order. Pass T for ascending or Nil for descending. If omitted, the order will be ascending.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found, does not support this function or if there is no such column.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_ListView_SortTextItems 
		MyControlReference [as Reference]
		nColIndex [as Integer]
		[Optional] bAscending [as Boolean])

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_ListView_SortTextItems
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		nColIndex [as Integer]
		[Optional] bAscending [as Boolean])

Applies For

BlockList, ListView.

Example

CopyCode imageCopy Code
; Sort the third column in ascending order
(Odcl_ListView_SortTextItems MyProject_MyForm_MyControl 2 T)

See Also

ListView_AddColumns, ListView_CalcColWidth, ListView_DeleteColumn, ListView_DeleteColumns, ListView_GetColumnCount, ListView_GetColumnImage, ListView_GetColumnItems, ListView_GetColWidth, ListView_SetColumnImage, ListView_SetColWidth, ListView_SortNumericItems