Forums » .NET » .NET »

How to uncheck the radio button in C#


Posted Date: 13 Apr 2010      Posted By:: G.Hemadribabu     Member Level: Gold    Member Rank: 452     Points: 1   Responses: 9



Hi,

I have 3 radio buttons in my c# form.

by default when i run the form, the first radio button is selected.

i want all the 3 radio buttons to be unchecked when i run that page.

pls suggest me the code..

and then i should select based on the requirements




Responses

#492870    Author: Asheej T K        Member Level: Diamond      Member Rank: 2     Date: 13/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

Remove "Selected="True" code from the RadioButtonList.


Regards,
Asheej T K
Microsoft MVP[ASP.NET/IIS]
DotNetSpider MVM


 
#492884    Author: Vikram Singh Saini      Member Level: Gold      Member Rank: 250     Date: 13/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

Hi,

I got the solution.


private void Form1_Load(object sender, EventArgs e)
{
this.radioButton1.TabStop = false;
this.radioButton2.TabStop = false;
this.radioButton3.TabStop = false;
this.radioButton4.TabStop = false;

}



(dont forget to rate)
Thanks and Regards,
Vikram Singh Saini

RESULTS MATTER, REASONS NOT!


 
#492886    Author: MuhiReks      Member Level: Gold      Member Rank: 75     Date: 13/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

while design mode set the checked property = false
or
On_Pageload

radiobtn.checked=flase
radiobtn1.checked=flase
radiobtn2.checked=flase

But if you have only radio button in your form , change TabIndex property to other value , because wen ever page load the focus wil be in TabIndex 0 , so automatically it will focus the radio button.

so set tabindex 0 to other control if you have in the form instead of radio

hope this help!

thnx
Muhil





 
#493118    Author: Sanjay C      Member Level: Gold      Member Rank: 674     Date: 13/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

by default radio button checked property is false.
and you write on page load event
rd1.checked=false;
rd2.checked=false;
rd3.checked=false;



thanks & regards

sanjay.c


 
#493131    Author: paul100      Member Level: Gold      Member Rank: 38     Date: 13/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

private void Form1_Activated(object sender, EventArgs e)
{
radioButton1.Checked = false;
radioButton2.Checked = false;
radioButton3.Checked = false;
}

Regards


 
#493472    Author: shamala      Member Level: Gold      Member Rank: 285     Date: 14/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

Just write a statement, like this rdn.checked=false

Subhashini


 
#493637    Author: Vikram Singh Saini      Member Level: Gold      Member Rank: 250     Date: 14/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

Hi,

To each and everyone answered!

He asked for making all radiobuttons checked to false. Even if you apply
radioButton1.Checked = false;
radioButton2.Checked = false;
radioButton3.Checked = false;
still one of the radiobutton will be checked on running the application based on the priority of tab index.

Let me know your opinions and thoughts on this.

(dont forget to rate)
Thanks and Regards,
Vikram Singh Saini

RESULTS MATTER, REASONS NOT!


 
#494609    Author: Aparna      Member Level: Silver      Member Rank: 2671     Date: 16/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

on page load

rb1.Checked = False;
rb2.Checked = False;
rb2.Checked = False;

Aparna Bhise


 
#494619    Author: asdfg      Member Level: Gold      Member Rank: 975     Date: 16/Apr/2010   Rating: 2 out of 52 out of 5     Points: 2

Hi Vikram Singh Saini
I think u had mistaken

Please check it once


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : DAtagridview
Previous : Add reference problem with Interop.BrssCom dll in c#.Net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India