473,396 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RadiobuttonList databind

nci
Hey,

In ASP.NET I have a Radiobuttonlist server control.
I do databinding to fill up :
this.RBList.DataSource = Methods.Items;
this.RBList.DataTextField = "Desc";
this.RBList.DataValueField = "Id";
this.RBList.DataBind();

this.RBList.SelectedValue = "01";

I want that one of the radiobuttons is as default preselected (the one with a datavalue = "01").

But this.RBList.SelectedValue = "01" don't work. When I go back to the page no radibutton is selected.

How I have to di this?
Thanks in advance
nic
Nov 16 '05 #1
1 13707
Hi

By default first item in radio button list will be selected. Just loop through the items and set selected propery to false. Then select the item which you want.

HTH
--
Ravikanth[MVP]
"nci" wrote:
Hey,

In ASP.NET I have a Radiobuttonlist server control.
I do databinding to fill up :
this.RBList.DataSource = Methods.Items;
this.RBList.DataTextField = "Desc";
this.RBList.DataValueField = "Id";
this.RBList.DataBind();

this.RBList.SelectedValue = "01";

I want that one of the radiobuttons is as default preselected (the one with a datavalue = "01").

But this.RBList.SelectedValue = "01" don't work. When I go back to the page no radibutton is selected.

How I have to di this?
Thanks in advance
nic

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 --...
6
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
2
by: hellrazor | last post by:
Hi there, I'm successfully streaming a list of items into a radiobuttonlist. I am using an ArrayList as a data source, which I have built from a table of values in a MySQL table. It's working...
0
by: TIBM | last post by:
Hi. I'm trying to come up with a customized RadioButtonList and I don't know where to start. My requirements are: I'll be given a dataset that contains one table with product data (eg price,...
5
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the...
2
by: Michael Bohman | last post by:
Hi, i have a small problem with assigning a database value to a RadioButtonList control. On my form i have 3 user admin=1, premium=2 and basic=3, theese values is stored in an access database in a...
0
by: rcoco | last post by:
Hi, Ihave a datagrid that Insert data in some rows. One column has RadioButtonList that contains three Items. But When I select one radiobuton, insert data in other columns and select insert data...
2
by: Vahagn | last post by:
Hi, how do I retrieve the chosen value from a RadioButtonList? I have a RadioButtonList that is populated dynamically with a "Next" button. Ie, I have a list of questions each with 2-3 answer...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.