Updated March 2013
The advanced column option InfDef=xxx allows you to specify some variations of XTREE editable cell behaviour using INFLD TYPE codes. This only applies globally for all columns in the tree, and only the following TYPE codes are supported:
Type |
Description |
) |
start cursor at end of field, requires e |
2 |
When cursor is at the start of a field, left arrow navigates to the previous editable cell. |
D |
In conjunction with a date field (cformat D), causes the field to be edited by the standard Windows Date and Time Picker control, rather than by the standard Windows edit control. See Comments below and also see Format. |
e |
force non-destructive |
||I |
Forces overwrite mode during editing (instead of the normal insert mode). You most likely would want to use this feature in conjunction with non-destructive mode (InfDef=||Ie), particularly when FastMax=# is being used. Note that ||I is the INFLD code to force overwrite mode. |
|L |
Regardless of cursor position within the field, right arrow navigates to the next editable cell. |
L |
When cursor is at the end of the field, right arrow navigates to next editable cell. |
O |
Indicates optional field. Mainly of use with dates and times (e.g. InfDef=DO) to add a checkbox to the Date and Time Picker to allow it to be optional. |
t |
In conjunction with a time field (cformat h), causes the field to be edited by the standard Windows Date and Time Picker control, rather than by the standard Windows edit control. |
For example:
Coldef = "1~8~Date~DE~InfDef=D~~"
Note that the InfDef clause is shared by all columns, so this method forces you to treat all editable date and time columns the same way.
In the above example, since the column width is 8, the format will be set to MM/DD/YY (or DD/MM/YY depending on the LDF). Otherwise the year would be returned in CCYY format.
The other method for activating or configuring the date/time picker control is to specify a Format clause.
Comments
Warning about date picker column width: For Windows Vista and later, the width of a column using InfDef=D will be automatically expanded as needed to fit the Windows date picker control (when a cell in the column is edited). But prior to Vista, this does not happen, and worse, if the column width is not sufficient for the date picker, the editing operation may be confusing at best. To avoid this, you may want to specify a DspMin option sufficient to accommodate the date picker. (You'll have to work out the actual minimum width using some trial and error, and/or err on the conservative side, since it changes according to the date format options specified, resolution, etc.)