By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,947 Members | 1,594 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,947 IT Pros & Developers. It's quick & easy.

How to disable one radio button in the RadioButtonList1 (asp.net)

P: n/a
I have created RadioButtonList1 having 2 radio buttons in the list.How to
make enable/disable only 1 radio button in the RadioButtonlist.

Thanks for your help.
Regards.
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
myRadioButtonList.Items[0].Enabled = false;

Wouter

Nov 20 '05 #2

P: n/a
ddd
I am using the below control
protected System.Web.UI.WebControls.RadioButtonList RadioButtonList1;

It doesnot have enabled property.Thanks

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #3

P: n/a
I am using the below control
protected System.Web.UI.WebControls.RadioButtonList RadioButtonList1;

It doesnot have enabled property.

Thanks
"Wouter van Vugt" <wo*****@infosupport.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
myRadioButtonList.Items[0].Enabled = false;

Wouter

Nov 21 '05 #4

P: n/a
I would replace the RadioButtonList with individual RadioButtons that are
wired to the same event handling method, e.g.

<asp:RadioButton AutoPostBack=True ID="Radiobutton1" Runat="server"
Text="value1" OnCheckedChanged
="Radiobutton_CheckedChanged"></asp:RadioButton>
<asp:RadioButton AutoPostBack=True ID="Radiobutton2" Runat="server"
Text="value2" OnCheckedChanged
="Radiobutton_CheckedChanged"></asp:RadioButton>
And in the codebehind:

protected void Radiobutton_CheckedChanged(object sender, System.EventArgs e)
{
//uncheck all radio buttons
Radiobutton1.Checked = false;
Radiobutton2.Checked = false;
//check the button that was clicked
RadioButton rb = (RadioButton)sender;
rb.Checked = true;
//do any other processing

}
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"enahar" wrote:
I have created RadioButtonList1 having 2 radio buttons in the list.How to
make enable/disable only 1 radio button in the RadioButtonlist.

Thanks for your help.
Regards.

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.