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

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --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 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.

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.
Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
void | dataBindColumn ( mixed $sender, mixed $param) Databinds a cell in the column.
TButtonColumnType | 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) Initializes the specified cell to its initial values.
void | setButtonType ( TButtonColumnType $value)
void | setCausesValidation ( boolean $value)
void | setCommandName ( string $value) Sets the command name associated with the Command event.
void | setDataImageUrlField ( string $value)
void | setDataImageUrlFormatString ( string $value)
void | setDataTextField ( string $value)
void | setDataTextFormatString ( string $value)
void | setImageUrl ( string $value)
void | setText ( string $value) Sets the text caption of the button.
void | setValidationGroup ( string $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()

Method Details

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

## getButtonType

public TButtonColumnType getButtonType | ()

Output
TButtonColumnType | the type of command button. Defaults to TButtonColumnType::LinkButton.
Exception

## getCausesValidation

public boolean getCausesValidation | ()

Output
boolean | whether postback event trigger by this button will cause input validation, default is true
Exception

## getCommandName

public string getCommandName | ()

Output
string | the command name associated with the OnCommand event.
Exception

## getDataImageUrlField

public string getDataImageUrlField | ()

Output
string | the field name from the data source to bind to the button image url
Exception

## getDataImageUrlFormatString

public string getDataImageUrlFormatString | ()

Output
string | the formatting string used to control how the button image url will be displayed.
Exception

## getDataTextField

public string getDataTextField | ()

Output
string | the field name from the data source to bind to the button caption
Exception

## getDataTextFormatString

public string getDataTextFormatString | ()

Output
string | the formatting string used to control how the button caption will be displayed.
Exception

## getImageUrl

public string getImageUrl | ()

Output
string | the URL of the image file for image buttons
Exception

## getText

public string getText | ()

Output
string | the text caption of the button
Exception

## getValidationGroup

public string getValidationGroup | ()

Output
string | the group of validators which the 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 a command button within the cell.

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

public void setButtonType | (TButtonColumnType $value )

Input
TButtonColumnType | $value | the type of command button
Output
Exception

## setCausesValidation

public void setCausesValidation | (boolean $value )

Input
boolean | $value | whether postback event trigger by this button will cause input validation
Output
Exception

## setCommandName

public void setCommandName | (string $value )

Sets the command name associated with the Command event.

Input
string | $value | the text caption to be set
Output
Exception

## setDataImageUrlField

public void setDataImageUrlField | (string $value )

Input
string | $value | the field name from the data source to bind to the button image url
Output
Exception

## setDataImageUrlFormatString

public void setDataImageUrlFormatString | (string $value )

Input
string | $value | the formatting string used to control how the button image url will be displayed.
Output
Exception

## setDataTextField

public void setDataTextField | (string $value )

Input
string | $value | the field name from the data source to bind to the button caption
Output
Exception

## setDataTextFormatString

public void setDataTextFormatString | (string $value )

Input
string | $value | the formatting string used to control how the button caption will be displayed.
Output
Exception

## setImageUrl

public void setImageUrl | (string $value )

Input
string | $value | the URL of the image file for image buttons
Output
Exception

## setText

public void setText | (string $value )

Sets the text caption of the button.

Input
string | $value | the text caption to be set
Output
Exception

## setValidationGroup

public void setValidationGroup | (string $value )

Input
string | $value | the group of validators which the button causes validation upon postback
Output
Exception