|
Class TButtonColumn
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 setText
Text and setDataTextField DataTextField properties. If both are
present, the latter takes precedence. The setDataTextField DataTextField
property refers to the name of the field in datasource whose value will be used
as the button caption. If setDataTextFormatString DataTextFormatString
is not empty, the value will be formatted before rendering.
The buttons in the column can be set to display as hyperlinks, push buttons
or images by setting the setButtonType ButtonType property. The setCommandName 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.
The buttons in the column can be accessed by one of the following two
methods:
$datagridItem->ButtonColumnID->Button
$datagridItem->ButtonColumnID->Controls[0]
The second method is possible because the button control created within the
datagrid cell is the first child.
-
TComponent
-
TApplicationComponent
-
TDataGridColumn
-
TButtonColumn
Methods summary
public
string
|
#
getText( )
Returns
string the text caption of the button
|
public
|
#
setText( string $value )
Sets the text caption of the button.
Sets the text caption of the button.
Parameters
- $value
string the text caption to be set
|
public
string
|
#
getDataTextField( )
Returns
string the field name from the data source to bind to the button caption
|
public
|
#
setDataTextField( string $value )
Parameters
- $value
string the field name from the data source to bind to the button caption
|
public
string
|
#
getDataTextFormatString( )
Returns
string the formatting string used to control how the button caption will be displayed.
|
public
|
#
setDataTextFormatString( string $value )
Parameters
- $value
string the formatting string used to control how the button caption will be displayed.
|
public
string
|
#
getImageUrl( )
Returns
string the URL of the image file for image buttons
|
public
|
#
setImageUrl( string $value )
Parameters
- $value
string the URL of the image file for image buttons
|
public
string
|
#
getDataImageUrlField( )
Returns
string the field name from the data source to bind to the button image url
|
public
|
#
setDataImageUrlField( string $value )
Parameters
- $value
string the field name from the data source to bind to the button image url
|
public
string
|
#
getDataImageUrlFormatString( )
Returns
string the formatting string used to control how the button image url will be
displayed.
|
public
|
#
setDataImageUrlFormatString( string $value )
Parameters
- $value
string the formatting string used to control how the button image url will be
displayed.
|
public
TButtonColumnType
|
#
getButtonType( )
Returns
TButtonColumnType
the type of command button. Defaults to TButtonColumnType::LinkButton.
|
public
|
|
public
string
|
#
getCommandName( )
Returns
string the command name associated with the OnCommand event.
|
public
|
#
setCommandName( string $value )
Sets the command name associated with the Command event.
Sets the command name associated with the Command event.
Parameters
- $value
string the text caption to be set
|
public
boolean
|
#
getCausesValidation( )
Returns
boolean whether postback event trigger by this button will cause input validation,
default is true
|
public
|
#
setCausesValidation( boolean $value )
Parameters
- $value
boolean whether postback event trigger by this button will cause input validation
|
public
string
|
#
getValidationGroup( )
Returns
string the group of validators which the button causes validation upon postback
|
public
|
#
setValidationGroup( string $value )
Parameters
- $value
string the group of validators which the button causes validation upon postback
|
public
|
#
initializeCell( TTableCell $cell, integer $columnIndex, string $itemType )
Initializes the specified cell to its initial values. This method overrides
the parent implementation. It creates a command button within the cell.
Initializes the specified cell to its initial values. This method overrides
the parent implementation. It creates a command button within the cell.
Parameters
- $cell
TTableCell
the cell to be initialized.
- $columnIndex
integer the index to the Columns property that the cell resides in.
- $itemType
string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
Overrides
|
public
|
#
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.
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.
|
Methods inherited from TDataGridColumn
formatDataValue(),
getAllowSorting(),
getDataFieldValue(),
getEnableCellGrouping(),
getFooterRenderer(),
getFooterStyle(),
getFooterText(),
getHeaderImageUrl(),
getHeaderRenderer(),
getHeaderStyle(),
getHeaderText(),
getID(),
getItemStyle(),
getOwner(),
getSortExpression(),
getViewState(),
getVisible(),
initialize(),
initializeFooterCell(),
initializeHeaderCell(),
loadState(),
saveState(),
setEnableCellGrouping(),
setFooterRenderer(),
setFooterText(),
setHeaderImageUrl(),
setHeaderRenderer(),
setHeaderText(),
setID(),
setOwner(),
setSortExpression(),
setViewState(),
setVisible()
|
Methods inherited from TComponent
__call(),
__construct(),
__destruct(),
__get(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
addParsedObject(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
|