VB.NET - how to uncheck already selected radiobutton

Asked By swenzy on 10-Mar-10 01:08 PM
end of post
Hesham Amin replied to swenzy on 10-Mar-10 01:17 PM
radioButton.Checked = False
Kirtan Patel replied to swenzy on 10-Mar-10 01:25 PM

if you place only one check box on Form even its checked Property is False It will be checked ..initially

but you can unchecked it using code


radioButton1.Checked = false;

F Cali replied to swenzy on 10-Mar-10 01:25 PM
You can use javascript for this purpose:

function clearRadioButton(rbName) {
   options = document.getElementsByName(rbName);

    for (var i=0; i < options.length; i++) {
        options[i].checked = false;
    }
}

Regards,
http://www.sql-server-helper.com/sql-server-2008/row-value-constructor-as-derived-table.aspx
Super Man replied to swenzy on 10-Mar-10 01:33 PM

radio box are mainly used to select one item from many items.

so we needed to check atleast one in the form,if we use radio button.

otherwise, we can make use of checkboxes. so user can select or not!!!!

if you want to unselect using coding than

radioButton1.Checked = false;