473,947 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deselect combobox

Hello,

When I bind a datasource to a combobox, the first item is always
selected, also when I set the SelectedValue property to -1 or 0. Also
when I call the form's bindingcontext. AddNew, the combobox is not always
showing an empty value.

Does anyone know how to deselect all items in a combobox in a way that
always works fine?

Greetings,
Christian.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
1 5440
** Note we do it twice, this will deselect it.

Me.ComboBox1.Se lectedIndex = -1
Me.ComboBox1.Se lectedIndex = -1

Regards - OHM


Christian Dokman wrote:
Hello,

When I bind a datasource to a combobox, the first item is always
selected, also when I set the SelectedValue property to -1 or 0. Also
when I call the form's bindingcontext. AddNew, the combobox is not
always showing an empty value.

Does anyone know how to deselect all items in a combobox in a way that
always works fine?

Greetings,
Christian.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2

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

Similar topics

1
8956
by: Keiron Waites | last post by:
Hi, I have two select fields with the multiple attribute so you can see all options. When a user clicks on one form, I would like to deselect anything from the other form. Is there a way to do this? eg document.forms.form.list1.selectedIndex='NULL'; ? Where can I find out about all options with regards to the DOM? Thanks,
3
3875
by: Notorious | last post by:
The following Javascript line will deselect the currently selected index of a select box for Netscape and Firefox, but will not deselect in Explorer 6. theForm.assignedLic.options.selected = false; Can anyone tell me what the workaround for IE is? Thanks,
6
3889
by: Orchid | last post by:
I have 2 fields with Radio button Data Type, and both fields with more than one options. On Field1, I want the user to select option1, then Field2 is shown and able to select. If the user selects Option2, then Field2 is not shown. I can have the hidden-field working properly. However, after the user selected Field1-Option1 and selected an Option on Field2, but cannot deselect the option on Field2 if change mind on Field1 selection. ...
4
7164
by: GJP | last post by:
Hello. I have two list boxes. One with a picture name, and one for the ID of that picture (both coming from a database). The user selects the name of the picture and presses a button, the picture and the picture ID are then moved to other list boxes. This works ok, but once this has been done, i dont want to delete the item from the origional listbox, i just want to deselect it, but i cant seem to do this.
2
11431
by: ahmad | last post by:
when i used the statment for(var i = 0; i < menu.length; i++) { menu.options.selected = "false"; } to deselect all the options within a list, it surprisingly selected all the options. I tried another option like menu.options.removeAttribute("selected");
1
14518
by: Heck | last post by:
Hi everyone. I have created a simple table called "ReceptionTable" to input all materials coming to a drilling rig. I have included in this table a yes/no field (check box) that is selected from a form called "returns", by doing this I select records for an append query and do some other things with this info. Any VBA code I could use to deselect these records (to uncheck) in the table when I close my form? Say my form is called uhmmm . ....
1
6868
by: VBNovice05 | last post by:
I run a search on my database and get items that fit that search in a datagrid. There are checkboxes already for each item. I need to create a select/deselect all checkbox at the top of the column and be able to select.deselect all items that I have found. I am using C#.Net Thanks in advance for this
18
2740
by: klove1209 | last post by:
Good afternoon, I would like to know if anyone can direct me as to how I can write a VBA code to deselect about 26 check boxes, for all records. I have been searching the internet, but I haven't came across anything. Right now I have a command button on the form, that is able to deselect one checkbox for a single record. I don't want to have to hard code in all the checkboxes names into VBA. Thanks
1
4612
by: Bailu | last post by:
Hi, I am a newbie in wxPython and doing a program with ListBox, I want to select and deselect items in this box, I have use self.devlist = wx.ListBox(self, style=wx.LB_MULTIPLE) self.Bind(wx.EVT_LISTBOX, self.select_dev, self.devlist) to create this box, but don't know how to implement self.select_dev
0
11577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11352
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10694
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9893
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6118
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4948
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 we have to send another system
3
3544
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.