TemplateColumn

TemplateColumn

System.Web.UI.WebControls (system.web.dll)class

This class represents a type of column that can be added to the DataGrid control. A TemplateColumn allows you to create fully customized output in the DataGrid by using templates. These templates are defined by using the .aspx (not the properties of this class), which is similar to the method used by the DataList and Repeater controls. Templates allow you to combine several different fields in a single column and add other HTML elements and ASP.NET controls.

In the TemplateColumn definition in the .aspx file, you can define up to four templates: HeaderTemplate, ItemTemplate, EditItemTemplate, and FooterTemplate. Inside these template definitions, you can insert data binding expressions or HTML and ASP.NET elements.

public class TemplateColumn : DataGridColumn {
// Public Constructors
   public TemplateColumn( );
// Public Instance Properties
   public virtual ITemplate EditItemTemplate{set; get; }
   public virtual ITemplate FooterTemplate{set; get; }
   public virtual ITemplate HeaderTemplate{set; get; }
   public virtual ITemplate ItemTemplate{set; get; }
// Public Instance Methods
   public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType); 
              // overrides DataGridColumn
}

Hierarchy

System.Object DataGridColumn(System.Web.UI.IStateManager) TemplateColumn



    Part I: Introduction to ASP.NET
    Part III: Namespace Reference
    Chapter 40. The System.Web.UI.MobileControls Namespace
    Chapter 42. The System.Web.UI.WebControls Namespace