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

[Solved] Dynamic grid with dynamic combobox

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 11 Aug 2009, 05:24 PM
I have successfully created a RadGrid dynamically against one datasource obejct using your example on creation in the Page_PreInit event. All is well. Now I want to change one of the columns to a RadComboBox using a different datasource programatically too. Using the Northwind database, I have one of the columns defined in the Page_PreInit as this:

Dim calcColumn2 As New GridBoundColumn
calcColumn2.UniqueName = "ProductName"
calcColumn2.HeaderText = "Product Name"
calcColumn2.DataField = "ProductName"
calcColumn2.SortExpression = "ProductName"
RadGrid1.MasterTableView.Columns.Add(calcColumn2)

How do I change this to reflect a comboxbox instead? I see examples of creating each control separately now I need an example of doing both dynamically.

TIA, Tom

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Aug 2009, 02:00 PM
Hello Tom,

You can create GridDropDownColumn if you want RadComboBox for editing otherwise you should use GridTemplateColumn with desired RadComboBox for ItemTemplate.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or