Class TEditCommandColumn
TEditCommandColumn class
TEditCommandColumn contains the Edit command buttons for editing data items in each row. TEditCommandColumn will create an edit button if a cell is not in edit mode. Otherwise an update button and a cancel button will be created within the cell. The button captions are specified using EditText, UpdateText, and CancelText. The buttons in the column can be set to display as hyperlinks, push or image buttons by setting the ButtonType property. When an edit button is clicked, the datagrid will generate an onEditCommand event. When an update/cancel button is clicked, the datagrid will generate an onUpdateCommand or an onCancelCommand You can write these event handlers to change the state of specific datagrid item. The CausesValidation and ValidationGroup properties affect the corresponding properties of the edit and update buttons. The cancel button does not cause validation by default. The command buttons in the column can be accessed by one of the following methods: - $datagridItem->ButtonColumnID->EditButton (or UpdateButton, CancelButton)
- $datagridItem->ButtonColumnID->Controls[0]
The second method is possible because the button control created within the datagrid cell is the first child.
Method Summary |
protected
mixed
|
createButton
( string $commandName, string $text, boolean $causesValidation, string $validationGroup)
Creates a button and initializes its properties.
|
TButtonColumnType
|
|
string
|
|
string
|
|
boolean
|
|
string
|
|
string
|
|
string
|
|
string
|
|
string
|
|
void
|
Initializes the specified cell to its initial values.
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
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 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()
|
Method Details |
createButton
protected mixed createButton |
(string $commandName , string $text , boolean $causesValidation , string $validationGroup ) |
Creates a button and initializes its properties.
The button type is determined by ButtonType.
Input |
string | $commandName | command name associated with the button |
string | $text | button caption |
boolean | $causesValidation | whether the button should cause validation |
string | $validationGroup | the validation group that the button belongs to |
Output |
mixed
| the newly created button. |
Exception |
|
getButtonType
Output |
TButtonColumnType
| the type of command button. Defaults to TButtonColumnType::LinkButton. |
Exception |
|
getCancelImageUrl
public string getCancelImageUrl |
() |
Output |
string
| the URL of the image file for cancel image buttons |
Exception |
|
getCancelText
public string getCancelText |
() |
Output |
string
| the caption of the cancel button. Defaults to 'Cancel'. |
Exception |
|
getCausesValidation
public boolean getCausesValidation |
() |
Output |
boolean
| whether postback event trigger by edit or update button will cause input validation, default is true |
Exception |
|
getEditImageUrl
public string getEditImageUrl |
() |
Output |
string
| the URL of the image file for edit image buttons |
Exception |
|
getEditText
public string getEditText |
() |
Output |
string
| the caption of the edit button. Defaults to 'Edit'. |
Exception |
|
getUpdateImageUrl
public string getUpdateImageUrl |
() |
Output |
string
| the URL of the image file for update image buttons |
Exception |
|
getUpdateText
public string getUpdateText |
() |
Output |
string
| the caption of the update button. Defaults to 'Update'. |
Exception |
|
getValidationGroup
public string getValidationGroup |
() |
Output |
string
| the group of validators which the edit or update button causes validation upon postback |
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 an update and a cancel button for cell in edit mode. Otherwise it creates an edit button.
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 |
|
setButtonType
|
setCancelImageUrl
public void setCancelImageUrl |
(string $value ) |
Input |
string | $value | the URL of the image file for cancel image buttons |
Output |
Exception |
|
setCancelText
public void setCancelText |
(string $value ) |
Input |
string | $value | the caption of the cancel button |
Output |
Exception |
|
setCausesValidation
public void setCausesValidation |
(boolean $value ) |
Input |
boolean | $value | whether postback event trigger by edit or update button will cause input validation |
Output |
Exception |
|
setEditImageUrl
public void setEditImageUrl |
(string $value ) |
Input |
string | $value | the URL of the image file for edit image buttons |
Output |
Exception |
|
setEditText
public void setEditText |
(string $value ) |
Input |
string | $value | the caption of the edit button |
Output |
Exception |
|
setUpdateImageUrl
public void setUpdateImageUrl |
(string $value ) |
Input |
string | $value | the URL of the image file for update image buttons |
Output |
Exception |
|
setUpdateText
public void setUpdateText |
(string $value ) |
Input |
string | $value | the caption of the update button |
Output |
Exception |
|
setValidationGroup
public void setValidationGroup |
(string $value ) |
Input |
string | $value | the group of validators which the edit or update button causes validation upon postback |
Output |
Exception |
|
|