473,397 Members | 2,068 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,397 software developers and data experts.

Setting the default value for radiobuttonlist

304 100+
hi,
m trying to set the default value for a radiobuttonlist using the below shown code,
Expand|Select|Wrap|Line Numbers
  1. Me.RadioButtonList2.SelectedValue = ds.Tables(0).Rows(0).Item("Id").ToString
  2.  
But unfortunately it doesn't work.
could anyone tell me as to whether the above method should work?
thanks,
gomzi.
May 8 '07 #1
2 6410
dip_developer
648 Expert 512MB
hi,
m trying to set the default value for a radiobuttonlist using the below shown code,
Expand|Select|Wrap|Line Numbers
  1. Me.RadioButtonList2.SelectedValue = ds.Tables(0).Rows(0).Item("Id").ToString
  2.  
But unfortunately it doesn't work.
could anyone tell me as to whether the above method should work?
thanks,
gomzi.
Nothing wrong in the code........
Please check whether ds.Tables(0).Rows(0).Item("Id").ToString corresponds to the exact value of RadioButtonList Item or not.......
May 8 '07 #2
gomzi
304 100+
Nothing wrong in the code........
Please check whether ds.Tables(0).Rows(0).Item("Id").ToString corresponds to the exact value of RadioButtonList Item or not.......

RadioButtonList2 has got two values ie 1 & 2.
Also,
ds.Tables(0).Rows(0).Item("Id").ToString returns either 1 or 2
and on using breakpoint its clearly visible that radiobuttonlist2 receives the value 2 when the control reaches the below line..
Me.RadioButtonList2.SelectedValue = ds.Tables(0).Rows(0).Item("Id").ToString

But, the value doesn't get set for RadioButtonList2 .
May 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load i create dynamically a table which contains a checkbox and a radiobuttonlist in each tablerow . The radiobuttonlist...
3
by: Janaka | last post by:
I've seen and used some samples where you can set the onclick attrubute to a Button control to get it to do some javascript a la : btnUse.Attributes = "DoSomeJS()"; However when i try and get...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
2
by: Alphonse Giambrone | last post by:
Hi all, I have two radiobuttonlist controls on a page. When a user checks 'No' for rblDeleted, I want to automatically set rblSendCard to 'No' and disable it. The javascript function I wrote to...
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...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
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...
1
by: =?Utf-8?B?VGhlRHJpZnRlcg==?= | last post by:
This seems to be one of the great mysteries of ASP.NET as I have seen numerous postings on this with absolutely no answers. SetFocus does not work on the RadioButtonList control. Does anybody...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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,...

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.