473,441 Members | 1,647 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,441 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 13708
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.