I need to have a control (currently trying to use listbox) where the user
can have nothing selected if they choose. Any way to do that with a list box
or would I be better off with a RadioButtonList? Any other bound controls I
should look into?
Thanks! 7 5938
deselect the listbox by setting the selectedindex to -1 in code
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"MattB" <so********@yahoo.com> wrote in message
news:2m************@uni-berlin.de... I need to have a control (currently trying to use listbox) where the user can have nothing selected if they choose. Any way to do that with a list box or would I be better off with a RadioButtonList? Any other bound controls I should look into?
Thanks!
Usually easiest done by adding an empty item at position zero after binding,
at leat that way the user can select nothing as an option
--
Regards
John Timney
Microsoft Regional Director
Microsoft MVP
"MattB" <so********@yahoo.com> wrote in message
news:2m************@uni-berlin.de... I need to have a control (currently trying to use listbox) where the user can have nothing selected if they choose. Any way to do that with a list
box or would I be better off with a RadioButtonList? Any other bound controls
I should look into?
Thanks!
Alvin Bruney [MVP] wrote: deselect the listbox by setting the selectedindex to -1 in code
I need to have a control (currently trying to use listbox) where the user can have nothing selected if they choose. Any way to do that with a list box or would I be better off with a RadioButtonList? Any other bound controls I should look into?
Thanks!
Thanks to you both!
Matt
Hi, just wondering how to add an empty item at position 0 after data binding as I have a listbox that is currently setup with a databind, after using a stored procedure to fill a dataset?
Thanks.
--
Paul G
Software engineer.
"John Timney (Microsoft MVP)" wrote: Usually easiest done by adding an empty item at position zero after binding, at leat that way the user can select nothing as an option
-- Regards
John Timney Microsoft Regional Director Microsoft MVP
"MattB" <so********@yahoo.com> wrote in message news:2m************@uni-berlin.de... I need to have a control (currently trying to use listbox) where the user can have nothing selected if they choose. Any way to do that with a list box or would I be better off with a RadioButtonList? Any other bound controls I should look into?
Thanks!
I agree with John on the the empty item for the scenario if a user selects and item and decides to not select something, then the listbox would save that item selected. This would not leave the user a choice unselect their initial choice.
"John Timney (Microsoft MVP)" wrote: Usually easiest done by adding an empty item at position zero after binding, at leat that way the user can select nothing as an option
-- Regards
John Timney Microsoft Regional Director Microsoft MVP
"MattB" <so********@yahoo.com> wrote in message news:2m************@uni-berlin.de... I need to have a control (currently trying to use listbox) where the user can have nothing selected if they choose. Any way to do that with a list box or would I be better off with a RadioButtonList? Any other bound controls I should look into?
Thanks!
With ddlRoutes
.DataSource = travelDB.GetRoutes
.DataTextField = "RouteName"
.DataValueField = "RouteID"
.DataBind()
.Items.Insert(0, New ListItem("-select route-", ""))
End With
HTH,
Greg
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com... Hi, just wondering how to add an empty item at position 0 after data
binding as I have a listbox that is currently setup with a databind, after
using a stored procedure to fill a dataset? Thanks. -- Paul G Software engineer.
"John Timney (Microsoft MVP)" wrote:
Usually easiest done by adding an empty item at position zero after
binding, at leat that way the user can select nothing as an option
-- Regards
John Timney Microsoft Regional Director Microsoft MVP
"MattB" <so********@yahoo.com> wrote in message news:2m************@uni-berlin.de... I need to have a control (currently trying to use listbox) where the
user can have nothing selected if they choose. Any way to do that with a
list box or would I be better off with a RadioButtonList? Any other bound
controls I should look into?
Thanks!
ok thanks it worked!
--
Paul G
Software engineer.
"Greg Burns" wrote: With ddlRoutes .DataSource = travelDB.GetRoutes .DataTextField = "RouteName" .DataValueField = "RouteID" .DataBind()
.Items.Insert(0, New ListItem("-select route-", "")) End With
HTH, Greg
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:A6**********************************@microsof t.com... Hi, just wondering how to add an empty item at position 0 after data binding as I have a listbox that is currently setup with a databind, after using a stored procedure to fill a dataset? Thanks. -- Paul G Software engineer.
"John Timney (Microsoft MVP)" wrote:
Usually easiest done by adding an empty item at position zero after binding, at leat that way the user can select nothing as an option
-- Regards
John Timney Microsoft Regional Director Microsoft MVP
"MattB" <so********@yahoo.com> wrote in message news:2m************@uni-berlin.de... > I need to have a control (currently trying to use listbox) where the user > can have nothing selected if they choose. Any way to do that with a list box > or would I be better off with a RadioButtonList? Any other bound controls I > should look into? > > Thanks! > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alienz |
last post by:
I have a subform where I have a subform with 20 options to select
from. When I set the multiselect property to simple and select
multiple options, nothing is stored. I have another table with...
|
by: Sally |
last post by:
I have a simple multiselect listbox with a rowsorce of MemberID, MemberName,
SendLetter. SendLetter is a Yes/No field. What is the code to set SendLetter to
Yes when the user selects MemberName? I...
|
by: collie |
last post by:
Hi,
I have 2 listboxes. The first gets populated from the db as soon as
the page loads. The second listbox get populated based on the user's
selection from the first listbox. However,...
|
by: Chris Leuty |
last post by:
I am populating a multiselect Listbox from a dataset, with the content of
the listbox filled by one table, and the selections determined from another
table. So far, I have been keeping the dataset...
|
by: Moe Sizlak |
last post by:
Hi There,
I am trying to return the value of a listbox control that is included as a
user control, I can return the name of the control but I can't access the
integer value of the selected item,...
|
by: collie |
last post by:
HI,
I need to populate 2 listboxes from a db. When the page loads then the
first listbox needs to be populated and based on selection from that
listbox the second listbox needs to be populated...
|
by: Zorpiedoman |
last post by:
The problem is this:
I have a list box. I set an array list as the datasource. I remove an item
from the array list. I set the listbox datasource to nothing. I set the
listbox datasource to...
|
by: php_Boi |
last post by:
i have designed an application that is a dynamic submission form. i
have text fields and listboxes. now i am able to retain the values of
the listboxes when i populate the listbox "manually"(single...
|
by: zdrakec |
last post by:
Hello all:
Clearly, I'm not getting it! Here is the scenario:
On a web page, I have two list boxen and a text box. The first listbox
is populated at page load time (if it is not a postback)....
|
by: dkohel |
last post by:
I have 2 list boxes on my form. I am trying to populate listbox B
with the selection from listbox A. I have set multi-select in both
boxes to Extended...
The user will select the items from...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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: 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: 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...
|
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...
| |