TDropDownListColumn represents a column that is bound to a field in a data source.
The cells in the column will be displayed using the data indexed by
{@link setDataTextField DataTextField}. You can customize the display by
setting {@link setDataTextFormatString DataTextFormatString}.
If {@link setReadOnly ReadOnly} is false, TDropDownListColumn will display cells in edit mode
with dropdown lists. Otherwise, a static text is displayed.
The currently selected dropndown list item is specified by the data indexed with
{@link setDataValueField DataValueField}.
There are two approaches to specify the list items available for selection.
The first approach uses template syntax as follows,
The second approach specifies a data source to be bound to the dropdown lists
by setting {@link setListDataSource ListDataSource}. Like generic list controls,
you may also want to specify which data fields are used for item values and texts
by setting {@link setListValueField ListValueField} and
{@link setListTextField ListTextField}, respectively.
Furthermore, the item texts may be formatted by using {@link setListTextFormatString ListTextFormatString}.
Note, if you specify {@link setListDataSource ListDataSource}, do it before
calling the datagrid's dataBind().
The dropdown list control in the TDropDownListColumn can be accessed by one of
the following two methods:
The second method is possible because the dropdown list control created within the
datagrid cell is the first child.
getDataTextField()
публичный Метод
getListTextField()
публичный Метод
public getListTextField ( ) : string |
Результат |
string |
the data field used to populate the texts of the dropdown list items. Defaults to empty. |
setDataTextField()
публичный Метод
If this is not set, the data specified via {@link getDataValueField DataValueField}
will be displayed in the column.
setListTextField()
публичный Метод