Skip to content

Create a DataItemTemplate object for the ASPxGridView at runtime. The grid cells display the ASPxHyperLink control created in the template.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/aspxgridview-dataitemtemplate-runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Create a DataItemTemplate object for the ASPxGridView at runtime. The grid cells display the ASPxHyperLink control created in the template.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •