I store radiobuttonlist values in the db using the string value of the radio
button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse
my dataentry form for edit, I search the database for the row containing the
data I want, and then populate all the form fields.
here is what I have so far. What I don't know what to do is for cases where
a dirty database has no associated value for the radiobuttonlist, I don't
want to select anything. How do I do that?
***************
dbaseReturnValue = arParms(17).Value.ToString() 'get value from returned
stored procedure call.
For Each li In RadioButtonList.Items
i += 1
If (RadioButtonList.Value = dbaseReturnValue Then //but Value is
not a valid member. what do i use?
RadioButtonList.SelectedValue = dbaseReturnValue
li.Selected = True
else
RadioButtonList.SelectedValue = ???????????
End If
Next
***************
Thank you,
Greg Hazzard 6 5643
Thank you Justin ! Of course, it sets it to a value out of the range of the
valid values.
And what about the comparison of the database value, eg. "radiobuttonvalue1"
?
Which property do I use to iterate through the list of radiobutton item
values to compare with say, "radiobuttonvalue1?" Is it
radionbuttonlist.items.??? or
radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you,
Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message
news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse my dataentry form for edit, I search the database for the row containing the data I want, and then populate all the form fields.
here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the radiobuttonlist, I
don't want to select anything. How do I do that? *************** dbaseReturnValue = arParms(17).Value.ToString() 'get value from
returned stored procedure call. For Each li In RadioButtonList.Items i += 1 If (RadioButtonList.Value = dbaseReturnValue Then //but Value
is not a valid member. what do i use? RadioButtonList.SelectedValue = dbaseReturnValue li.Selected = True else RadioButtonList.SelectedValue = ??????????? End If Next *************** Thank you, Greg Hazzard
Thank you Justin ! Of course, it sets it to a value out of the range of the
valid values.
And what about the comparison of the database value, eg. "radiobuttonvalue1"
?
Which property do I use to iterate through the list of radiobutton item
values to compare with say, "radiobuttonvalue1?" Is it
radionbuttonlist.items.??? or
radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you,
Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message
news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse my dataentry form for edit, I search the database for the row containing the data I want, and then populate all the form fields.
here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the radiobuttonlist, I
don't want to select anything. How do I do that? *************** dbaseReturnValue = arParms(17).Value.ToString() 'get value from
returned stored procedure call. For Each li In RadioButtonList.Items i += 1 If (RadioButtonList.Value = dbaseReturnValue Then //but Value
is not a valid member. what do i use? RadioButtonList.SelectedValue = dbaseReturnValue li.Selected = True else RadioButtonList.SelectedValue = ??????????? End If Next *************** Thank you, Greg Hazzard
Greg,
'---This code seems like more work but I've found it to be the fastest way
to iterate
' through a loop because it calls on less objects
Dim ItemCount, ItemLoop As Int32
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = dbaseReturnValue Then
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next
Justin
"Hazzard" <ha**@sonic.net> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl... Thank you Justin ! Of course, it sets it to a value out of the range of
the valid values. And what about the comparison of the database value, eg.
"radiobuttonvalue1" ? Which property do I use to iterate through the list of radiobutton item values to compare with say, "radiobuttonvalue1?" Is it radionbuttonlist.items.??? or radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you, Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse my dataentry form for edit, I search the database for the row
containing the data I want, and then populate all the form fields.
here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the radiobuttonlist, I don't want to select anything. How do I do that? *************** dbaseReturnValue = arParms(17).Value.ToString() 'get value from returned stored procedure call. For Each li In RadioButtonList.Items i += 1 If (RadioButtonList.Value = dbaseReturnValue Then //but
Value is not a valid member. what do i use? RadioButtonList.SelectedValue = dbaseReturnValue li.Selected = True else RadioButtonList.SelectedValue = ??????????? End If Next *************** Thank you, Greg Hazzard
Greg,
'---This code seems like more work but I've found it to be the fastest way
to iterate
' through a loop because it calls on less objects
Dim ItemCount, ItemLoop As Int32
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = dbaseReturnValue Then
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next
Justin
"Hazzard" <ha**@sonic.net> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl... Thank you Justin ! Of course, it sets it to a value out of the range of
the valid values. And what about the comparison of the database value, eg.
"radiobuttonvalue1" ? Which property do I use to iterate through the list of radiobutton item values to compare with say, "radiobuttonvalue1?" Is it radionbuttonlist.items.??? or radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you, Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse my dataentry form for edit, I search the database for the row
containing the data I want, and then populate all the form fields.
here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the radiobuttonlist, I don't want to select anything. How do I do that? *************** dbaseReturnValue = arParms(17).Value.ToString() 'get value from returned stored procedure call. For Each li In RadioButtonList.Items i += 1 If (RadioButtonList.Value = dbaseReturnValue Then //but
Value is not a valid member. what do i use? RadioButtonList.SelectedValue = dbaseReturnValue li.Selected = True else RadioButtonList.SelectedValue = ??????????? End If Next *************** Thank you, Greg Hazzard
Thank you Justin! It even floats over a dirty database. Clean algorithm.
_greg
************************************
arReturnParms(x) = arParms(x).Value.ToString() 'value returned from
database stored procedure.
RadioButtonList.SelectedIndex = -1 'no radio buttons
checked
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = arReturnParms(x) Then
'unless there is a match
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next
******************************
"S. Justin Gengo" <ge****@krause.com> wrote in message
news:vh************@corp.supernews.com... Greg,
'---This code seems like more work but I've found it to be the fastest way to iterate
' through a loop because it calls on less objects
Dim ItemCount, ItemLoop As Int32
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = dbaseReturnValue Then
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next Justin
"Hazzard" <ha**@sonic.net> wrote in message news:Ot**************@TK2MSFTNGP11.phx.gbl... Thank you Justin ! Of course, it sets it to a value out of the range of the valid values. And what about the comparison of the database value, eg. "radiobuttonvalue1" ? Which property do I use to iterate through the list of radiobutton item values to compare with say, "radiobuttonvalue1?" Is it radionbuttonlist.items.??? or radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you, Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... > I store radiobuttonlist values in the db using the string value of
the radio > button item value. (nvarchar) > > I am creating an edit functionality on the asp.net form so that when
I reuse > my dataentry form for edit, I search the database for the row containing the > data I want, and then populate all the form fields. > > here is what I have so far. What I don't know what to do is for
cases where > a dirty database has no associated value for the radiobuttonlist, I don't > want to select anything. How do I do that? > *************** > dbaseReturnValue = arParms(17).Value.ToString() 'get value from returned > stored procedure call. > For Each li In RadioButtonList.Items > i += 1 > If (RadioButtonList.Value = dbaseReturnValue Then //but Value is > not a valid member. what do i use? > RadioButtonList.SelectedValue = dbaseReturnValue > li.Selected = True > else > RadioButtonList.SelectedValue = ??????????? > End If > Next > *************** > Thank you, > Greg Hazzard > >
Thank you Justin! It even floats over a dirty database. Clean algorithm.
_greg
************************************
arReturnParms(x) = arParms(x).Value.ToString() 'value returned from
database stored procedure.
RadioButtonList.SelectedIndex = -1 'no radio buttons
checked
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = arReturnParms(x) Then
'unless there is a match
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next
******************************
"S. Justin Gengo" <ge****@krause.com> wrote in message
news:vh************@corp.supernews.com... Greg,
'---This code seems like more work but I've found it to be the fastest way to iterate
' through a loop because it calls on less objects
Dim ItemCount, ItemLoop As Int32
ItemCount = RadioButtonList.Items.Count - 1
For ItemLoop = 0 To ItemCount
If RadioButtonList.Items(ItemLoop).Value = dbaseReturnValue Then
RadioButtonList.SelectedIndex = ItemLoop
Exit For
End If
Next Justin
"Hazzard" <ha**@sonic.net> wrote in message news:Ot**************@TK2MSFTNGP11.phx.gbl... Thank you Justin ! Of course, it sets it to a value out of the range of the valid values. And what about the comparison of the database value, eg. "radiobuttonvalue1" ? Which property do I use to iterate through the list of radiobutton item values to compare with say, "radiobuttonvalue1?" Is it radionbuttonlist.items.??? or radiobutton.items.searchbyvalue("radiobuttonvalue1 ")..
thank you, Greg
"S. Justin Gengo" <ge****@krause.com> wrote in message news:vh***********@corp.supernews.com... Hazzard,
Have you tried:
RadioButtonList.SelectedIndex = -1
I hope this helps.
Justin
"Hazzard" <ha**@sonic.net> wrote in message news:uY**************@TK2MSFTNGP11.phx.gbl... > I store radiobuttonlist values in the db using the string value of
the radio > button item value. (nvarchar) > > I am creating an edit functionality on the asp.net form so that when
I reuse > my dataentry form for edit, I search the database for the row containing the > data I want, and then populate all the form fields. > > here is what I have so far. What I don't know what to do is for
cases where > a dirty database has no associated value for the radiobuttonlist, I don't > want to select anything. How do I do that? > *************** > dbaseReturnValue = arParms(17).Value.ToString() 'get value from returned > stored procedure call. > For Each li In RadioButtonList.Items > i += 1 > If (RadioButtonList.Value = dbaseReturnValue Then //but Value is > not a valid member. what do i use? > RadioButtonList.SelectedValue = dbaseReturnValue > li.Selected = True > else > RadioButtonList.SelectedValue = ??????????? > End If > Next > *************** > Thank you, > Greg Hazzard > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hazzard |
last post by:
I store radiobuttonlist values in the db using the string value of the radio
button item value. (nvarchar)
I am creating an edit functionality on the asp.net form so that when I reuse
my...
|
by: Christian H |
last post by:
Hi!
I'm wondering how I can add extra html to a radiobuttonList, so that I can
control how:
-the whole radioButtonList is rendered.
-each of the radiobutton elements are rendered.
What I am...
|
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 --...
|
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...
|
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...
| |
by: standon410 |
last post by:
Hi,
I'm trying to develop a questionnaire...basically a user can pick one
of 5 questionnaires they want to use, and based on their choice, those
questions will appear in their form.
So the...
|
by: frankiefrank |
last post by:
Hello,
I have an aspx page with a RadioButtonList that has two Items, and a "ComboBox" (DropDownList) that I want to populate based on the selection in the RadioButtonList.
The first...
|
by: axapta |
last post by:
How can I programmatically change the selected item within the above
control. I only have 2 items within it and I want to set the default
(programmatically) to item 1.
I've tried...
|
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...
|
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,...
|
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...
| |
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,...
|
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: 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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |