This is a migrated thread and some comments may be shown as answers.

[Solved] Creating Dynamic Columns with different Controls

1 Answer 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 08 May 2008, 01:08 PM
Hi. I've downloaded the demo and what I'm not seeing or am unable to figure out is whether or not you can dynamically generate columns that have different control types.

Here's one example: I have a grid that has two columns. The first column is just text, values generated from reading from a table (these values can always be different and of varying count). The second column needs to either have a control that is a DropDownList or some version of a TextBox depending on the dataType of the field value read from the database.

Is it somehow possible to make a column vary in the types of controls it displays and uses when the grid is dynamically generated?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 May 2008, 03:45 PM
Hi Andrew,

If you create a template column you can assign desired ItemTemplate and EditItemTemplate according to your logic. Please check this help article related to dynamic templates:

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html

Regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or