Hi friends,
i would like to know all about the use of the tool called RadioButtonList, especially how to use a value selected from that radioButtonList to set for example the next textBox ReadOnly (if radioButtonList_name is selected then textbox_name.ReadOnly=true)!
so Please help me I need it quickly!
THANKS A LOT!

Rakrus106 reputationPosted Nov 13, 2007, 6:45 PM EST
Hi,
In the design mode of RadioButtonList double click on RadioButtonList then it takes you into code behind file with event "RadioButtonListName_SelectedIndexChanged".Here you can set textbox as readonly.
Note:Make sure that for RadioButtonList property AutoPostBack is True
kamonyo ric8 reputationPosted Nov 24, 2007, 10:07 PM EST
Thx Mr Rakrus,
But I would like to know how to do that with only one value!!
e.g: a RadioButtonList with 3 values (married,single,divorced) and a textBox(HusbandName), I would like to set that RadioButtonList so that When I select the radioButton "single", the textBox(HusbandName) is set readOnly!
Please Help me,
Thx a lot!
chanchal Abraham Cheeran8 reputationPosted Nov 27, 2007, 11:47 PM EST
Hi,
To make the textbox readonly when you select 'single' from the radiobutton list , you need to follow the following code
you need to write the code in RadioButtonList1_SelectedIndexChanged()
if(RadioButtonList1.SelectedItem.Text=="single")
{
TextBox1.ReadOnly=true;
}
else
{
TextBox1.ReadOnly=false;
}
this is the C# code
kamonyo ric8 reputationPosted Nov 28, 2007, 7:58 PM EST
THANKS A LOT MY FRIEND,
IT HAS BEEN SO HELPFUL!
I HOPE IT IS THE SAME AS CHECKBOXLIST!
SEE YOU !
P.S:
But I have another problem with my aspnet_regsql command in Visual Studio Cross Tools Command Prompt .
When I try to execute that command the wizard displays a messageBox with the error message :"Failed to query a list of database names from the SQL Server . Invalid object name 'sysdatabases'."
So please if you are again able to help me, tell me what is wrong with my Visual Studio or my SQL? Is it a problem of bad installation of my VS2005?
Best regards,
K.Ric.
kamonyo ric8 reputationPosted Nov 29, 2007, 10:31 PM EST
Thanks a lot friends,
It has been a pleasure to be helped by you.
The problem was in my SQL Server 2005 Components installation.
Some components were missing.
Thanks again.
Best regards,
K.Ric.