hi,
I have a rad grid with edit for mas like below.
<EditFormSettings EditFormType="Template">
<FormTemplate>
<tr>
<td style="width: 140px;">
</td>
<td>
<asp:RadioButtonList ID="rbtntagtype" runat="server" AutoPostBack="true" onselectedindexchanged="rbtntagtype_SelectedIndexChanged" >
<asp:ListItem Text="Service" Value="Service" Selected="True"></asp:ListItem>
<asp:ListItem Text="Doctor" Value="Doctor"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td style="width: 140px;">
<asp:Label ID="Label2" runat="server" Text="Service Tags"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlservicetag" runat="server">
</asp:DropDownList>
</td>
</tr>
</FormTemplate>
</EditFormSettings>
I have a Radio button list.
Based on the radio button list selection have to load the values to drop down.
In code behind i written like below.
protected void rbtntagtype_SelectedIndexChanged(object sender, EventArgs e)
{
RadioButtonList rbtntag = (RadioButtonList)sender;
GridEditableItem edititem = (sender as DropDownList).NamingContainer as GridEditableItem;
DropDownList ddList = edititem.FindControl("ddlservicetag") as DropDownList;
DataSet dl_loadservice = new DataSet();
if (rbtntag.SelectedItem.Value == "Doctor")
{
dl_loadservice = objClass_RegisterDept.fn_getservicetags(true);
}
else
{
dl_loadservice = objClass_RegisterDept.fn_getservicetags(false);
}
ddList.DataSource = dl_loadservice;
ddList.DataTextField = "tagname";
ddList.DataValueField = "tagid";
ddList.DataBind();
ddList.Items.Insert(0, "Select");
}
in selected index chnage itis saying
GridEditableItem edititem = (sender as DropDownList).NamingContainer as GridEditableItem;
is null..
can anyone suggest me how do i proceed with this..
I have a rad grid with edit for mas like below.
<EditFormSettings EditFormType="Template">
<FormTemplate>
<tr>
<td style="width: 140px;">
</td>
<td>
<asp:RadioButtonList ID="rbtntagtype" runat="server" AutoPostBack="true" onselectedindexchanged="rbtntagtype_SelectedIndexChanged" >
<asp:ListItem Text="Service" Value="Service" Selected="True"></asp:ListItem>
<asp:ListItem Text="Doctor" Value="Doctor"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td style="width: 140px;">
<asp:Label ID="Label2" runat="server" Text="Service Tags"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlservicetag" runat="server">
</asp:DropDownList>
</td>
</tr>
</FormTemplate>
</EditFormSettings>
I have a Radio button list.
Based on the radio button list selection have to load the values to drop down.
In code behind i written like below.
protected void rbtntagtype_SelectedIndexChanged(object sender, EventArgs e)
{
RadioButtonList rbtntag = (RadioButtonList)sender;
GridEditableItem edititem = (sender as DropDownList).NamingContainer as GridEditableItem;
DropDownList ddList = edititem.FindControl("ddlservicetag") as DropDownList;
DataSet dl_loadservice = new DataSet();
if (rbtntag.SelectedItem.Value == "Doctor")
{
dl_loadservice = objClass_RegisterDept.fn_getservicetags(true);
}
else
{
dl_loadservice = objClass_RegisterDept.fn_getservicetags(false);
}
ddList.DataSource = dl_loadservice;
ddList.DataTextField = "tagname";
ddList.DataValueField = "tagid";
ddList.DataBind();
ddList.Items.Insert(0, "Select");
}
in selected index chnage itis saying
GridEditableItem edititem = (sender as DropDownList).NamingContainer as GridEditableItem;
is null..
can anyone suggest me how do i proceed with this..