## Class TBoundColumn

Description

TBoundColumn class

TBoundColumn 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 DataField. You can customize the display by setting DataFormatString.

If ReadOnly is false, TBoundColumn will display cells in edit mode with textboxes. Otherwise, a static text is displayed.

When a datagrid row is in edit mode, the textbox control in the TBoundColumn can be accessed by one of the following two methods:

     $datagridItem->BoundColumnID->TextBox
     $datagridItem->BoundColumnID->Controls[0]

The second method is possible because the textbox control created within the datagrid cell is the first child.

Since v3.1.0, TBoundColumn has introduced two new properties ItemRenderer and EditItemRenderer which can be used to specify the layout of the datagrid cells in browsing and editing mode. A renderer refers to a control class that is to be instantiated as a control. For more details, see TRepeater and TDataList.

- since: 3.0
- version: $Id: TBoundColumn.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TBoundColumn.php (line 49)

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TBoundColumn

Method Summary
void dataBindColumn (mixed $sender, mixed $param)
string getDataField ()
string getDataFormatString ()
string getEditItemRenderer ()
string getItemRenderer ()
boolean getReadOnly ()
void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)
void setDataField (string $value)
void setDataFormatString (string $value)
void setEditItemRenderer (string $value)
void setItemRenderer (string $value)
void setReadOnly (boolean $value)
Methods
dataBindColumn (line 223)

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.

- access: public

void dataBindColumn (mixed $sender, mixed $param)
getDataField (line 110)

- return: the field name from the data source to bind to the column
- access: public

string getDataField ()
getDataFormatString (line 126)

- return: the formatting string used to control how the bound data will be displayed.
- access: public

string getDataFormatString ()
getEditItemRenderer (line 83)

- return: the class name for the edit item cell renderer. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getEditItemRenderer ()
getItemRenderer (line 55)

- return: the class name for the item cell renderer. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getItemRenderer ()
getReadOnly (line 142)

- return: whether the items in the column can be edited. Defaults to false.
- access: public

boolean getReadOnly ()
initializeCell (line 166)

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.

- access: public

void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)

- 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)

Redefinition of:

TDataGridColumn::initializeCell()
  Initializes the specified cell to its initial values.

setDataField (line 118)

- access: public

void setDataField (string $value)

- string $value: the field name from the data source to bind to the column

setDataFormatString (line 134)

- access: public

void setDataFormatString (string $value)

- string $value: the formatting string used to control how the bound data will be displayed.

setEditItemRenderer (line 102)

Sets the edit item cell renderer class.

If not empty, the class will be used to instantiate as a child control in the item cell that is in edit mode.

If the class implements IDataRenderer, the Data property will be set as the data associated with the datagrid cell during databinding. The data can be either the whole data row or a field of the row if DataField is not empty. If DataFormatString is not empty, the data will be formatted first before passing to the renderer.

- access: public
- since: 3.1.0

void setEditItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setItemRenderer (line 74)

Sets the item cell renderer class.

If not empty, the class will be used to instantiate as a child control in the item cells of the column.

If the class implements IDataRenderer, the Data property will be set as the data associated with the datagrid cell during databinding. The data can be either the whole data row or a field of the row if DataField is not empty. If DataFormatString is not empty, the data will be formatted first before passing to the renderer.

- access: public
- since: 3.1.0

void setItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setReadOnly (line 150)

- access: public

void setReadOnly (boolean $value)

- boolean $value: whether the items in the column can be edited

#### Inherited 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()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

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()

Documentation generated on Sun, 11 Jan 2009 20:18:10 -0500 by phpDocumentor 1.3.0RC4