Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 3.65 KB

File metadata and controls

41 lines (26 loc) · 3.65 KB

Grid View for ASP.NET Web Forms - Create a DataItemTemplate for a column at Runtime

This example demonstrates how to create a column cell template at runtime. Grid cells display the ASPxHyperLink control created in the template.

ASPxGridView-DataItemTemplate

Implementation Details

Declare a custom class that implements the ITemplate interface.

In the class's InstantiateIn method, create controls that make up the template and add them to the control collection of a container passed as this method's parameter. The container type is different for each template type. For a DataItemTemplate object, the container is of the GridViewDataItemTemplateContainer type. Use the container's properties to obtain a row's information. For example, use the KeyValue property to get a row key (container.KeyValue).

Create an instance of the template class and assign it to the column's DataItemTemplate property.

Files to Look At

Documentation

More Examples

Does This Example Address Your Development Requirements/Objectives?

(you will be redirected to DevExpress.com to submit your response)