Hi,
I'm looking at the sample that embeds a RadGrid in a RadComboBox (http://www.telerik.com/help/aspnet-ajax/grid-in-combobox.html) and I see that you can add the RadGrid to the RadComboBox declaratively in the aspx:
I need to be able to do this in the code behind and I can't figure out how to set the ItemTemplate to a RadGrid properly given it must be an ITemplate:
Is it possible to do this in the code behind?
Thanks,
Ken
I'm looking at the sample that embeds a RadGrid in a RadComboBox (http://www.telerik.com/help/aspnet-ajax/grid-in-combobox.html) and I see that you can add the RadGrid to the RadComboBox declaratively in the aspx:
<!-- edited from sample, aspx simplifies to this: -->
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
>
<
ItemTemplate
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
>
...
</
telerik:RadGrid
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
I need to be able to do this in the code behind and I can't figure out how to set the ItemTemplate to a RadGrid properly given it must be an ITemplate:
protected
void
Page_Init(
object
sender, EventArgs e)
{
//create basic grid
RadGrid grid =
new
RadGrid();
grid.ID =
"RadGrid1"
;
grid.NeedDataSource += RadGrid1_NeedDataSource;
grid.AllowSorting =
true
;
grid.MasterTableView.AutoGenerateColumns =
true
;
//try mimic aspx page implementation... not possible because of Type mismatch
RadComboBox1.ItemTemplate = grid;
}
Is it possible to do this in the code behind?
Thanks,
Ken