I have 2 radcombobox in radgrid , radcombobox A and radcombobox B.
The the grid is in add record mode in some situation , radcombobox B content are based on the selection on radcombobox A.
My problem is under the situation where the radcombobox B is not bind to any data, i can't find the radcombobox B by the coding below:
radCombo2 = CType(editItem.FindControl("ddlModuleParentGC"), RadComboBox)radCombo2 = CType(editItem.FindControl("ddlModuleParentGC"), RadComboBox)
My question is as below:
(1).Since the radcombobox B content is based on selection on radcombobox A , does anyone know how to bind the data to the radcombobox B when the radgrid first go into add record mode? I think this will solve the problem.Pls correct me if i am wrong.
(2) My coding is as below
RadComboBox A=ddlAppID
RadComboBox B= ddlModuleParentGC
My code behind is
The the grid is in add record mode in some situation , radcombobox B content are based on the selection on radcombobox A.
My problem is under the situation where the radcombobox B is not bind to any data, i can't find the radcombobox B by the coding below:
radCombo2 = CType(editItem.FindControl("ddlModuleParentGC"), RadComboBox)radCombo2 = CType(editItem.FindControl("ddlModuleParentGC"), RadComboBox)
My question is as below:
(1).Since the radcombobox B content is based on selection on radcombobox A , does anyone know how to bind the data to the radcombobox B when the radgrid first go into add record mode? I think this will solve the problem.Pls correct me if i am wrong.
(2) My coding is as below
RadComboBox A=ddlAppID
RadComboBox B= ddlModuleParentGC
| Public Sub BindSecondCombo(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) |
| Dim radCombo1 As RadComboBox |
| Dim radCombo2 As RadComboBox |
| Dim editItem As GridDataInsertItem |
| radCombo1 = CType(sender, RadComboBox) |
| editItem = CType(radCombo1.NamingContainer, GridDataInsertItem) |
| radCombo2 = CType(editItem.FindControl("ddlModuleParentGC"), RadComboBox) |
| If radCombo2 Is Nothing = False Then |
| radCombo2.ClearSelection() |
| radCombo2.DataSource = getRecordByType(7, radCombo1.SelectedValue, "", "", "", "", "") |
| radCombo2.DataTextField = "modulename" |
| radCombo2.DataValueField = "moduleid" |
| radCombo2.DataBind() |
| radCombo2.DataSource = getRecordByType(7, radCombo1.SelectedValue, "", "", "", "", "") |
| radCombo2.DataTextField = "modulename" |
| radCombo2.DataValueField = "moduleid" |
| radCombo2.DataBind() |
| End If |
| End Sub |
My code behind is
| <ajax:GridTemplateColumn UniqueName="GCAppId" HeaderText="Application" SortExpression="AppId" > |
| <HeaderStyle Width="100px" /> |
| <ItemTemplate> |
| <asp:Label ID="lblGCAppId" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AppId") %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:Label ID="lblGCEAppId" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AppId") %>'></asp:Label> |
| <ajax:RadComboBox runat="server" ID="ddlAppId" DataSource="<%# getApp() %>" OnSelectedIndexChanged="BindSecondCombo" |
| DataTextField="Selection" AutoPostBack ="true" |
| DataValueField="AppId" |
| SelectedValue='<%# DataBinder.Eval(Container.DataItem, "AppId") %>'></ajax:RadComboBox> |
| </EditItemTemplate> |
| </ajax:GridTemplateColumn> |
| <ajax:GridTemplateColumn UniqueName="GCModuleParent" HeaderText="Module Parent" SortExpression="ModuleParent" > |
| <HeaderStyle Width="100px" /> |
| <ItemTemplate> |
| <asp:Label ID="lblModuleParent" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ModuleParent") %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <ajax:RadComboBox runat="server" ID="ddlModuleParentGC" ></ajax:RadComboBox> |
| <asp:textbox ID="txtModuleParent" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ModuleParent") %>'></asp:textbox> |
| </EditItemTemplate> |
| </ajax:GridTemplateColumn> |