Hi. I've got a RadComboBox inside an EditItemTemplate that gets populated in the code behind. It needs to get populated in the code behind because the list it shows is specific to the parent table. When I perform an automatic update everything updates except this one RadComboBox. Thanks.
C#
ASPX
C#
| protected void rgEnvironments_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name != "environments") |
| { |
| GridDataItem dataItem = e.Item.OwnerTableView.ParentItem; |
| int id = Intranet.Str2Int(dataItem.GetDataKeyValue("system_id").ToString()); |
| GridEditableItem moduleEdited = (GridEditableItem)e.Item; |
| GridEditableItem editItem = (GridEditableItem)e.Item; |
| Literal msv = (Literal)moduleEdited.FindControl("ltlModuleEdit"); // Grab selectedvalue from hidden literal |
| RadComboBox moduleCombo = (RadComboBox)moduleEdited["module"].FindControl("rcbModule"); |
| moduleCombo.DataSource = GetModuleDataTable(id); |
| moduleCombo.DataTextField = "module"; |
| moduleCombo.DataValueField = "module_id"; |
| moduleCombo.DataBind(); |
| if (null != msv) |
| moduleCombo.SelectedValue = msv.Text; |
| } |
| } |
ASPX
| <telerik:GridTemplateColumn HeaderText="Module" UniqueName="module" HeaderStyle-Width="16%"> |
| <ItemTemplate> |
| <asp:Literal ID="ltlModule" Text='<%# Bind("module") %>' runat="server" /></ItemTemplate> |
| <EditItemTemplate> |
| <asp:Literal ID="ltlModuleEdit" Text='<%# Bind("module_id") %>' Visible="false" runat="server" /> |
| <telerik:RadComboBox ID="rcbModule" runat="server" Skin="Default" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |