## Class TButtonColumn

Description

TButtonColumn class

TButtonColumn contains a user-defined command button, such as Add or Remove, that corresponds with each row in the column.

The caption of the buttons in the column is determined by Text and DataTextField properties. If both are present, the latter takes precedence. The DataTextField property refers to the name of the field in datasource whose value will be used as the button caption. If DataTextFormatString is not empty, the value will be formatted before rendering.

The buttons in the column can be set to display as hyperlinks or push buttons by setting the ButtonType property. The CommandName will assign its value to all button's CommandName property. The datagrid will capture the command event where you can write event handlers based on different command names. The buttons' CausesValidation and ValidationGroup property values are determined by the column's corresponding properties.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TButtonColumn.php (line 47)

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TButtonColumn

Method Summary
void dataBindColumn (mixed $sender, mixed $param)
string getButtonType ()
boolean getCausesValidation ()
string getCommandName ()
string getDataImageUrlField ()
string getDataImageUrlFormatString ()
string getDataTextField ()
string getDataTextFormatString ()
string getImageUrl ()
string getText ()
string getValidationGroup ()
void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)
void setButtonType (string $value)
void setCausesValidation (boolean $value)
void setCommandName (string $value)
void setDataImageUrlField (string $value)
void setDataImageUrlFormatString (string $value)
void setDataTextField (string $value)
void setDataTextFormatString (string $value)
void setImageUrl (string $value)
void setText (string $value)
void setValidationGroup (string $value)
Methods
dataBindColumn (line 249)

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)
getButtonType (line 149)

- return: the type of command button. Defaults to LinkButton.
- access: public

string getButtonType ()
getCausesValidation (line 182)

- return: whether postback event trigger by this button will cause input validation, default is true
- access: public

boolean getCausesValidation ()
getCommandName (line 165)

- return: the command name associated with the OnCommand event.
- access: public

string getCommandName ()
getDataImageUrlField (line 117)

- return: the field name from the data source to bind to the button image url
- access: public

string getDataImageUrlField ()
getDataImageUrlFormatString (line 133)

- return: the formatting string used to control how the button image url will be displayed.
- access: public

string getDataImageUrlFormatString ()
getDataTextField (line 69)

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

string getDataTextField ()
getDataTextFormatString (line 85)

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

string getDataTextFormatString ()
getImageUrl (line 101)

- return: the URL of the image file for image buttons
- access: public

string getImageUrl ()
getText (line 52)

- return: the text caption of the button
- access: public

string getText ()
getValidationGroup (line 198)

- return: the group of validators which the button causes validation upon postback
- access: public

string getValidationGroup ()
initializeCell (line 219)

Initializes the specified cell to its initial values.

This method overrides the parent implementation. It creates a command button within the cell.

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

setButtonType (line 157)

- access: public

void setButtonType (string $value)

- string $value: the type of command button, LinkButton, PushButton or ImageButton

setCausesValidation (line 190)

- access: public

void setCausesValidation (boolean $value)

- boolean $value: whether postback event trigger by this button will cause input validation

setCommandName (line 174)

Sets the command name associated with the Command event.

- access: public

void setCommandName (string $value)

- string $value: the text caption to be set

setDataImageUrlField (line 125)

- access: public

void setDataImageUrlField (string $value)

- string $value: the field name from the data source to bind to the button image url

setDataImageUrlFormatString (line 141)

- access: public

void setDataImageUrlFormatString (string $value)

- string $value: the formatting string used to control how the button image url will be displayed.

setDataTextField (line 77)

- access: public

void setDataTextField (string $value)

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

setDataTextFormatString (line 93)

- access: public

void setDataTextFormatString (string $value)

- string $value: the formatting string used to control how the button caption will be displayed.

setImageUrl (line 109)

- access: public

void setImageUrl (string $value)

- string $value: the URL of the image file for image buttons

setText (line 61)

Sets the text caption of the button.

- access: public

void setText (string $value)

- string $value: the text caption to be set

setValidationGroup (line 206)

- access: public

void setValidationGroup (string $value)

- string $value: the group of validators which the button causes validation upon postback

#### Inherited Methods

Inherited From TDataGridColumn

> TDataGridColumn::formatDataValue()
> TDataGridColumn::getDataFieldValue()
> TDataGridColumn::getFooterStyle()
> TDataGridColumn::getFooterText()
> TDataGridColumn::getHeaderImageUrl()
> TDataGridColumn::getHeaderStyle()
> TDataGridColumn::getHeaderText()
> TDataGridColumn::getItemStyle()
> TDataGridColumn::getOwner()
> TDataGridColumn::getSortExpression()
> TDataGridColumn::getViewState()
> TDataGridColumn::getVisible()
> TDataGridColumn::initialize()
> TDataGridColumn::initializeCell()
> TDataGridColumn::loadState()
> TDataGridColumn::saveState()
> TDataGridColumn::setFooterText()
> TDataGridColumn::setHeaderImageUrl()
> TDataGridColumn::setHeaderText()
> 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::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> 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, 04 Jun 2006 18:58:42 -0400 by phpDocumentor 1.3.0RC4