0
thanks for replying.
Actually, what i need to do is --
I have a gridview, in that I placed radiobuttonlist with three radio buttons and text box.
when I check the two radio buttons, the text should be enabled and for another radiobutton, textbox must be disabled.
I wrote the code but it's not working
<asp:TemplateField HeaderText="DD PaidStatus" Visible="True" >
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Enabled="false" Visible ="false" Text='<%# Bind("PaidStatus") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblpaidstatus" runat="server" Text='<%# Bind("PaidStatus") %>' Visible="False"></asp:Label>
<asp:RadioButtonList ID="rblist11" runat="server" RepeatDirection ="Horizontal" Enabled ="true" AutoPostBack="false" DataMember="PaidStatus" DataValueField="PaidStatus" OnSelectedIndexChanged = "rblist11_SelectedIndexChanged" >
<asp:ListItem Value="1">Paid</asp:ListItem>
<asp:ListItem Selected="True" Value="0">NotPaid</asp:ListItem>
<asp:ListItem Value="2">Exempted</asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amount">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Amount") %>' ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Amount") %>' Visible="False"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Amount") %>' Width="59px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
protected void rblist11_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (GridViewRow item in GridView1.Rows)
{
RadioButtonList rbl = item.FindControl("rblist11") as RadioButtonList;
TextBox txtamount = item.FindControl("TextBox3") as TextBox;
if (rbl.SelectedItem.Value == "0")
{
txtamount.Enabled = false;
}
else if ((rbl.SelectedItem.Value == "1") || (rbl.SelectedItem.Value == "2"))
{
txtamount.Enabled = true;
}
}
}
plz help me..

0
hi...
in gridview if your radiobuttons are non-editable then write them in ItemTemplate this way
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<RadioButtonID="cb" runat="server" />
</ItemTemplate>
</asp:TemplateField>
if it help you mark my answer