- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages: default System System.Caching System.Collections System.Data System.Data.ActiveRecord System.Data.ActiveRecord.Relations System.Data.ActiveRecord.Scaffold System.Data.ActiveReecord.Scaffold.InputBuilder System.Data.Commom.Sqlite System.Data.Common System.Data.Common.Mssql System.Data.Common.Mysql System.Data.Common.Oracle System.Data.Common.Pgsql System.Data.Common.Sqlite System.Data.DataGateway System.Data.SqlMap System.Data.SqlMap.Configuration System.Data.SqlMap.Statements System.Exceptions System.I18N System.IO System.Security System.Util System.Web System.Web.Services System.Web.UI System.Web.UI.ActiveControls System.Web.UI.WebControls System.Web.UI.WebControls.assets System.Xml Classes: IDataSource IItemDataRenderer IRepeatInfoUser TActiveFileUpload TBaseDataList TBaseValidator TBoundColumn TBulletedList TBulletedListDisplayMode TBulletedListEventParameter TBulletStyle TButton TButtonColumn TButtonColumnType TButtonType TCaptcha TCaptchaValidator TCheckBox TCheckBoxColumn TCheckBoxList TCircleHotSpot TClientScript TClientScriptLoader TClientSideValidationSummaryOptions TColorPicker TColorPickerClientSide TColorPickerMode TCompareValidator TCompleteWizardStep TConditional TContent TContentDirection TContentPlaceHolder TCustomValidator TDataBoundControl TDataGrid TDataGridColumn TDataGridColumnCollection TDataGridCommandEventParameter TDataGridItem TDataGridItemCollection TDataGridItemEventParameter TDataGridItemRenderer TDataGridPageChangedEventParameter TDataGridPager TDataGridPagerButtonType TDataGridPagerEventParameter TDataGridPagerMode TDataGridPagerPosition TDataGridPagerStyle TDataGridSortCommandEventParameter TDataList TDataListCommandEventParameter TDataListItem TDataListItemCollection TDataListItemEventParameter TDataListItemRenderer TDataRenderer TDataSourceControl TDataSourceSelectParameters TDataSourceView TDataTypeValidator TDatePicker TDatePickerClientScript TDatePickerInputMode TDatePickerMode TDatePickerPositionMode TDisplayStyle TDraggable TDropContainer TDropDownList TDropDownListColumn TEditCommandColumn TEmailAddressValidator TExpression TFileUpload TFont THiddenField THorizontalAlign THotSpot THotSpotCollection THotSpotMode THtmlArea THtmlElement THyperLink THyperLinkColumn TImage TImageButton TImageClickEventParameter TImageMap TImageMapEventParameter TInlineFrame TInlineFrameAlign TInlineFrameScrollBars TItemDataRenderer TJavascriptLogger TKeyboard TLabel TLinkButton TListBox TListControl TListControlValidator TListItem TListItemCollection TListItemType TListSelectionMode TLiteral TLiteralColumn TMarkdown TMetaTag TMetaTagCollection TMultiView TOutputCache TOutputCacheCalculateKeyEventParameter TOutputCacheCheckDependencyEventParameter TPager TPagerButtonType TPagerMode TPagerPageChangedEventParameter TPanel TPanelStyle TPlaceHolder TPolygonHotSpot TRadioButton TRadioButtonList TRangeValidationDataType TRangeValidator TRatingList TReadOnlyDataSource TReadOnlyDataSourceView TRectangleHotSpot TRegularExpressionValidator TRepeatDirection TRepeater TRepeaterCommandEventParameter TRepeaterItem TRepeaterItemCollection TRepeaterItemEventParameter TRepeaterItemRenderer TRepeatInfo TRepeatLayout TRequiredFieldValidator TSafeHtml TScrollBars TServerValidateEventParameter TSlider TSliderClientScript TSliderDirection TStatements TStyle TStyleSheet TTable TTableCaptionAlign TTableCell TTableCellCollection TTableFooterRow TTableGridLines TTableHeaderCell TTableHeaderRow TTableHeaderScope TTableItemStyle TTableRow TTableRowCollection TTableRowSection TTableStyle TTabPanel TTabView TTabViewCollection TTemplateColumn TTemplatedWizardStep TTextAlign TTextBox TTextBoxAutoCompleteType TTextBoxMode TTextHighlighter TTextHighlighterLineNumberStyle TValidationCompareOperator TValidationDataType TValidationSummary TValidationSummaryDisplayMode TValidationSummaryDisplayStyle TValidatorClientSide TValidatorDisplayStyle TVerticalAlign TView TViewCollection TWebControl TWebControlAdapter TWizard TWizardFinishNavigationTemplate TWizardNavigationButtonStyle TWizardNavigationButtonType TWizardNavigationContainer TWizardNavigationEventParameter TWizardNavigationTemplate TWizardSideBarListItemTemplate TWizardSideBarTemplate TWizardStartNavigationTemplate TWizardStep TWizardStepCollection TWizardStepNavigationTemplate TWizardStepType TXmlTransform |
Keyword
# Class TDropDownListColumn
    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TDropDownListColumn
TDropDownListColumn class 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 DataTextField. You can customize the display by setting DataTextFormatString. If 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 DataValueField. There are two approaches to specify the list items available for selection. The first approach uses template syntax as follows,

       <com:TDropDownListColumn ....>
         <com:TListItem Value="1" Text="first item" />
         <com:TListItem Value="2" Text="second item" />
         <com:TListItem Value="3" Text="third item" />
       </com:TDropDownListColumn>
The second approach specifies a data source to be bound to the dropdown lists by setting ListDataSource. Like generic list controls, you may also want to specify which data fields are used for item values and texts by setting ListValueField and ListTextField, respectively. Furthermore, the item texts may be formatted by using ListTextFormatString. Note, if you specify 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:

     $datagridItem->DropDownListColumnID->DropDownList
     $datagridItem->DropDownListColumnID->Controls[0]
The second method is possible because the dropdown list control created within the datagrid cell is the first child. Since: 3.0.4 Author: Qiang Xue <qiang.xue@gmail.com>
Constructor Summary
public | __construct
Method Summary
void | addParsedObject ( mixed $object) Adds object parsed from template to the control.
void | dataBindColumn ( mixed $sender, mixed $param) Databinds a cell in the column.
string | getDataTextField ()
string | getDataTextFormatString ()
string | getDataValueField ()
Traversable | getListDataSource ()
string | getListTextField ()
string | getListTextFormatString ()
string | getListValueField ()
boolean | getReadOnly ()
void | initializeCell ( TTableCell $cell, integer $columnIndex, string $itemType) Initializes the specified cell to its initial values.
void | loadState ( mixed $state) Loads items from viewstate.
void | saveState () Saves items into viewstate.
void | setDataTextField ( string $value) Sets the field of the data source that provides the text content of the column.
void | setDataTextFormatString ( string $value)
void | setDataValueField ( string $value) Sets the field of the data source that provides the key selecting an item in dropdown list.
void | setListDataSource ( Traversable|array|string $value)
void | setListTextField ( string $value)
void | setListTextFormatString ( string $value)
void | setListValueField ( string $value)
void | setReadOnly ( boolean $value)
Methods Inherited From TDataGridColumn
TDataGridColumn::formatDataValue(), TDataGridColumn::getAllowSorting(), TDataGridColumn::getDataFieldValue(), TDataGridColumn::getEnableCellGrouping(), TDataGridColumn::getFooterRenderer(), TDataGridColumn::getFooterStyle(), TDataGridColumn::getFooterText(), TDataGridColumn::getHeaderImageUrl(), TDataGridColumn::getHeaderRenderer(), TDataGridColumn::getHeaderStyle(), TDataGridColumn::getHeaderText(), TDataGridColumn::getID(), TDataGridColumn::getItemStyle(), TDataGridColumn::getOwner(), TDataGridColumn::getSortExpression(), TDataGridColumn::getViewState(), TDataGridColumn::getVisible(), TDataGridColumn::initialize(), TDataGridColumn::initializeCell(), TDataGridColumn::initializeFooterCell(), TDataGridColumn::initializeHeaderCell(), TDataGridColumn::loadState(), TDataGridColumn::saveState(), TDataGridColumn::setEnableCellGrouping(), TDataGridColumn::setFooterRenderer(), TDataGridColumn::setFooterText(), TDataGridColumn::setHeaderImageUrl(), TDataGridColumn::setHeaderRenderer(), TDataGridColumn::setHeaderText(), TDataGridColumn::setID(), TDataGridColumn::setOwner(), TDataGridColumn::setSortExpression(), TDataGridColumn::setViewState(), TDataGridColumn::setVisible()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods Inherited From TComponent
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
Constructor Details
## __construct
public __construct |
Method Details
## addParsedObject
public void addParsedObject | (mixed $object )
Adds object parsed from template to the control. This method adds only TListItem objects into the getItems collection. All other objects are ignored.
Input
mixed | $object | object parsed from template
Output
Exception
## dataBindColumn
public void dataBindColumn | (mixed $sender , mixed $param )
Databinds a cell in the column. This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source.
Input
mixed | $sender |
mixed | $param |
Output
Exception
## getDataTextField
public string getDataTextField | ()
Output
string | the field of the data source that provides the text content of the column.
Exception
## getDataTextFormatString
public string getDataTextFormatString | ()
Output
string | the formatting string used to control how the bound data will be displayed.
Exception
## getDataValueField
public string getDataValueField | ()
Output
string | the field of the data source that provides the key selecting an item in dropdown list.
Exception
## getListDataSource
public Traversable getListDataSource | ()
Output
Traversable | data source to be bound to the dropdown list boxes.
Exception
## getListTextField
public string getListTextField | ()
Output
string | the data field used to populate the texts of the dropdown list items. Defaults to empty.
Exception
## getListTextFormatString
public string getListTextFormatString | ()
Output
string | the formatting string used to control how the list item texts will be displayed.
Exception
## getListValueField
public string getListValueField | ()
Output
string | the data field used to populate the values of the dropdown list items. Defaults to empty.
Exception
## getReadOnly
public boolean getReadOnly | ()
Output
boolean | whether the items in the column can be edited. Defaults to false.
Exception
## initializeCell
public void initializeCell | (TTableCell $cell , integer $columnIndex , string $itemType )
Initializes the specified cell to its initial values. This method overrides the parent implementation. It creates a textbox for item in edit mode and the column is not read-only. Otherwise it displays a static text. The caption of the button and the static text are retrieved from the datasource.
Input
TTableCell | $cell | the cell to be initialized.
integer | $columnIndex | the index to the Columns property that the cell resides in.
string | $itemType | the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
Output
Exception
## loadState
public void loadState | (mixed $state )
Loads items from viewstate. This method overrides the parent implementation by loading list items
Input
mixed | $state | state values
Output
Exception
## saveState
public void saveState | ()
Saves items into viewstate. This method overrides the parent implementation by saving list items
Output
Exception
## setDataTextField
public void setDataTextField | (string $value )
Sets the field of the data source that provides the text content of the column. If this is not set, the data specified via DataValueField will be displayed in the column.
Input
string | $value | the field of the data source that provides the text content of the column.
Output
Exception
## setDataTextFormatString
public void setDataTextFormatString | (string $value )
Input
string | $value | the formatting string used to control how the bound data will be displayed.
Output
Exception
## setDataValueField
public void setDataValueField | (string $value )
Sets the field of the data source that provides the key selecting an item in dropdown list. If this is not present, the data specified via DataTextField (without applying the formatting string) will be used for selection, instead.
Input
string | $value | the field of the data source that provides the key selecting an item in dropdown list.
Output
Exception
## setListDataSource
public void setListDataSource | (Traversable|array|string $value )
Input
Traversable|array|string | $value | data source to be bound to the dropdown list boxes.
Output
Exception
## setListTextField
public void setListTextField | (string $value )
Input
string | $value | the data field used to populate the texts of the dropdown list items
Output
Exception
## setListTextFormatString
public void setListTextFormatString | (string $value )
Input
string | $value | the formatting string used to control how the list item texts will be displayed.
Output
Exception
## setListValueField
public void setListValueField | (string $value )
Input
string | $value | the data field used to populate the values of the dropdown list items
Output
Exception
## setReadOnly
public void setReadOnly | (boolean $value )
Input
boolean | $value | whether the items in the column can be edited
Output
Exception