Intersoft WebGrid Documentation
CellTemplate Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGridColumn Class : CellTemplate Property






Gets or sets the template applied to the cells of this column.

Syntax

Visual Basic (Declaration) 
<TemplateContainerAttribute(BindingDirection=BindingDirection.TwoWay, ContainerType=ISNet.WebUI.WebGrid.WebGridCellTemplateContainer)>
<PersistenceModeAttribute(PersistenceMode.InnerProperty)>
<BrowsableAttribute(False)>
<DescriptionAttribute("Gets or sets the cell template of this Column.")>
Public Property CellTemplate As ITemplate
Visual Basic (Usage)Copy Code
Dim instance As WebGridColumn
Dim value As ITemplate
 
instance.CellTemplate = value
 
value = instance.CellTemplate
C# 
[TemplateContainerAttribute(BindingDirection=BindingDirection.TwoWay, ContainerType=ISNet.WebUI.WebGrid.WebGridCellTemplateContainer)]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[BrowsableAttribute(false)]
[DescriptionAttribute("Gets or sets the cell template of this Column.")]
public ITemplate CellTemplate {get; set;}
Delphi 
public read-write property CellTemplate: ITemplate; 
JScript 
TemplateContainerAttribute(BindingDirection=BindingDirection.TwoWay, ContainerType=ISNet.WebUI.WebGrid.WebGridCellTemplateContainer)
PersistenceModeAttribute(PersistenceMode.InnerProperty)
BrowsableAttribute()
DescriptionAttribute("Gets or sets the cell template of this Column.")
public function get,set CellTemplate : ITemplate
Managed Extensions for C++ 
[TemplateContainerAttribute(BindingDirection=BindingDirection.TwoWay, ContainerType=ISNet.WebUI.WebGrid.WebGridCellTemplateContainer)]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[BrowsableAttribute(false)]
[DescriptionAttribute("Gets or sets the cell template of this Column.")]
public: __property ITemplate* get_CellTemplate();
public: __property void set_CellTemplate( 
   ITemplate* value
);
C++/CLI 
[TemplateContainerAttribute(BindingDirection=BindingDirection.TwoWay, ContainerType=ISNet.WebUI.WebGrid.WebGridCellTemplateContainer)]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[BrowsableAttribute(false)]
[DescriptionAttribute("Gets or sets the cell template of this Column.")]
public:
property ITemplate^ CellTemplate {
   ITemplate^ get();
   void set (    ITemplate^ value);
}

Example

 

Remarks

Using this property you can put server side controls when using Template Column Type. Thus, this property enables developers to achieve broader scenario using professional server-side programming. When you use Template column and you would like to allow grouping, sorting, and editing on Templated column, you need to specify the DataMember. This enables WebGrid to use native value of represented row item for the data operation purpose.

The following example shows how to use Eval or Bind method for declarative data binding in the child controls of the CellTemplate.

<ISWebGrid:WebGridColumn Caption="ContactName" ColumnType="Template"    DataMember="ContactName" Name="ContactName" Width="200px"> <CellTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ContactName") %>' ForeColor="Red" Font-Italic="true" /> </CellTemplate>

</ISWebGrid:WebGridColumn>

 

 

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.