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

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TTemplateColumn

TTemplateColumn class

TTemplateColumn customizes the layout of controls in the column with templates. In particular, you can specify ItemTemplate, EditItemTemplate, HeaderTemplate and FooterTemplate to customize specific type of cells in the column.

Since v3.1.0, TTemplateColumn 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.

When a renderer and a template are both defined for a type of item, the former takes precedence.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
void | dataBindColumn ( mixed $sender, mixed $param) Databinds a cell in the column.
string | getEditItemRenderer ()
ITemplate | getEditItemTemplate ()
ITemplate | getFooterTemplate ()
ITemplate | getHeaderTemplate ()
string | getItemRenderer ()
ITemplate | getItemTemplate ()
void | initializeCell ( TTableCell $cell, integer $columnIndex, string $itemType) Initializes the specified cell to its initial values.
void | setEditItemRenderer ( string $value) Sets the edit item cell renderer class.
void | setEditItemTemplate ( ITemplate $value)
void | setFooterTemplate ( ITemplate $value)
void | setHeaderTemplate ( ITemplate $value)
void | setItemRenderer ( string $value) Sets the item cell renderer class.
void | setItemTemplate ( ITemplate $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

## getEditItemRenderer

public string getEditItemRenderer | ()

Output
string | the class name for the edit item cell renderer. Defaults to empty, meaning not set.
Exception

## getEditItemTemplate

public ITemplate getEditItemTemplate | ()

Output
ITemplate | the edit item template
Exception

## getFooterTemplate

public ITemplate getFooterTemplate | ()

Output
ITemplate | the footer template
Exception

## getHeaderTemplate

public ITemplate getHeaderTemplate | ()

Output
ITemplate | the header template
Exception

## getItemRenderer

public string getItemRenderer | ()

Output
string | the class name for the item cell renderer. Defaults to empty, meaning not set.
Exception

## getItemTemplate

public ITemplate getItemTemplate | ()

Output
ITemplate | the item template
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 initializes the cell based on different templates (ItemTemplate, EditItemTemplate, HeaderTemplate, FooterTemplate).

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

## setEditItemRenderer

public void setEditItemRenderer | (string $value )

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 row of the data associated with the datagrid item that this cell resides in.

Input
string | $value | the renderer class name in namespace format.
Output
Exception

## setEditItemTemplate

public void setEditItemTemplate | (ITemplate $value )

Input
ITemplate | $value | the edit item template
Output
Exception
throws | TInvalidDataTypeException if the input is not an ITemplate or not null.

## setFooterTemplate

public void setFooterTemplate | (ITemplate $value )

Input
ITemplate | $value | the footer template
Output
Exception
throws | TInvalidDataTypeException if the input is not an ITemplate or not null.

## setHeaderTemplate

public void setHeaderTemplate | (ITemplate $value )

Input
ITemplate | $value | the header template.
Output
Exception
throws | TInvalidDataTypeException if the input is not an ITemplate or not null.

## setItemRenderer

public void setItemRenderer | (string $value )

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 row of the data associated with the datagrid item that this cell resides in.

Input
string | $value | the renderer class name in namespace format.
Output
Exception

## setItemTemplate

public void setItemTemplate | (ITemplate $value )

Input
ITemplate | $value | the item template
Output
Exception
throws | TInvalidDataTypeException if the input is not an ITemplate or not null.