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

[Solved] populate dropdown in template column from code behind

2 Answers 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 17 Apr 2008, 09:49 PM
I have a combobox in the templatecolumn in my grid.

<

telerik:GridTemplateColumn HeaderText="Device Type" SortExpression="DeviceDisplayValue"

UniqueName="DeviceTemplateColumn" EditFormColumnIndex="1">

<ItemTemplate>

<asp:Label runat="server" ID="lblDevice" Text='<%# Bind("DeviceDisplayValue") %>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>

<telerik:RadComboBox ID="ddlDeviceAW" runat="server"  EnableLoadOnDemand="true"

LoadingMessage="Loading Device..." MarkFirstMatch="True" ToolTip="Select a Device"

OnItemsRequested="ddlDeviceAW_ItemsRequested" EnableVirtualScrolling="true">

</telerik:RadComboBox>

</EditItemTemplate>

</telerik:GridTemplateColumn>

I want to populate the dropdown from code behind on runtime.
How do i find the combo box in the grid in my ItemsRequested event?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Apr 2008, 06:21 AM
Hi newbie,

You can cast sender to the combo in ddlDeviceAW_ItemsRequested. Here is an example:

RadComboBox combo = sender as RadComboBox;

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
newbie
Top achievements
Rank 1
answered on 18 Apr 2008, 08:28 PM
Thanks
that worked!
Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Vlad
Telerik team
newbie
Top achievements
Rank 1
Share this question
or