Skip to content

DefaultIndex - cWebColumn

Returns the best index for this grid column based on the DEO's data binding

Type: Function
Return Data Type: Integer

Syntax

Function DefaultIndex Returns Integer

Call Example

Get DefaultIndex to IntegerVariable

Description

This returns the best index for this web column data entry object (DEO) based on the DEO's Server and data-binding (as defined by the Entry_Item command). If this DEO has no data-binding or there is no good index for it, it returns -1.

This function is only called if peDbGridType is set to gtAutomatic. If peDbGridType is gtAllData or gtManual, this function is not called.

This is called as part of the DEO's initialization and is used to determine if and how a list can be sorted by a grid column. If the piDefaultIndex property has not been explicitly set (i.e. it is -1), it will call this function to determine if there is a good index for this column. If there is, it will set piDefaultIndex to this index. You will rarely need to use this. If you want to define a specific index for a column, it is best to set piDefaultIndex yourself.

If the column DEO's binding table (Data_File) is different from the grid's Main_File (usually a parent), this will return -1 unless the grid's peRequestFindMode is rfmFindMainSuper. This rfmFindMainSuper allows for special support for prompt lists that allow you to order a column based on a related parent index (a super find).