I'm trying to use a drop-down list to edit a column in a RadGrid. The values in the drop-down are pre-determined, as in the example below. When I do this, the DropDownList shows up in the Edit Item template, but when I select a value and save, the value doesn't get saved to the Grid (though a textbox in the same grid does update the grid, so I know everything else is working ok).
Obviously, the RadGrid doesn't know to bind the selected item from the DropDownList to the "Department" column. When specifying a DropDownList declaratively like this, how do I bind the selected item to the column in the RadGrid?
<telerik:GridTemplateColumn UniqueName="Department" HeaderText="Department"> |
<ItemTemplate> |
<asp:Label ID="DepartmentLabel" runat="server"> |
<%# DataBinder.Eval(Container.DataItem, "Department") %> |
</asp:Label> |
</ItemTemplate> |
<EditItemTemplate> |
<asp:DropDownList ID="DepartmentDropDown" runat="server"> |
<asp:ListItem Text="Choose a Department" Value="" /> |
<asp:ListItem Text="100 - Dept A" Value="100 - Dept A" /> |
<asp:ListItem Text="200 - Dept B" Value="200 - Dept B" /> |
<asp:ListItem Text="300 - Dept C" Value="300 - Dept C" /> |
<asp:ListItem Text="400 - Dept D" Value="400 - Dept D" /> |
</asp:DropDownList> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
Regards,
Mike