The data source a TListControl can be binded to one of the following types of collection;
An array
A class that implements Traversible (e.g. ArrayObject, TCollection).
Each item in the data source can be one of the following:
An object that implements the IListItemSource interface. This is
useful for binding objects to a list source, that can then be asked
to provide the Text and Value data for the list item.
A scalar value, or object that can be converted to a string.
An array or an object implementing Traversible interface.
If this is the case, the DataTextField and
DataValueField properties of the list control MUST be set so the
control knows which index of the array to get the Text and Value
data for the item in the list.
Properties
EncodeText, boolean, default=true, kept in viewstate
Gets or sets the value indicating whether Text in list items should be HTML-encoded when rendering.
AutoPostBack, boolean, kept in viewstate
Gets or sets whether a postback response will be initiated when the selection
of the list changes.
Items, TCollection, read-only, kept in viewstate
Gets the collection of list items defined for this control.
DataSource, object, iterable
Gets or sets the data source this list control will use
DataTextField, string, kept in viewstate
Gets or sets the index to use into a data source item to
retrieve the Text property for the list item
DataValueField, string, kept in viewstate
Gets or sets the index to use into a data source item to
retrieve the Value property for the list item
DataTextFormatString, string, kept in viewstate
Gets or sets the format string to use for the Text property of the
list item. The format string is used as the first parameter to the ssprintf() function to transform the item text.
SelectedItem, TListItem, read-only
Gets the selected item that has the lowest cardinal index.
SelectedIndex, integer, default=-1
Gets or sets the index of the selected item. Note, setting a SelectedIndex will
clear all other selected indexes.
SelectedValue, string
Gets or sets the item with a value. Note, when setting a selection by value,
if the value is not found, an exception will be raised. If found, the rest selections
will be cleared.
Events
OnSelectionChanged Occurs when the selection of the list changes
abstract:
version:
$Revision: 1.38 $, last update on $Date: 2005/09/07 04:11:02 $
a value indicating whether an automatic postback to the server will occur whenever the user modifies the selection of the list control and then tabs out of it.
This method is invoked when the value of the Selection property changes between posts to the server.
The method raises 'OnSelectionChanged' event to fire up the event delegates. If you override this method, be sure to call the parent implementation so that the event delegates can be invoked.