473,396 Members | 1,826 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,396 software developers and data experts.

Combo box bindings

Hi,

Is it OK to bind a combo box to more than one datasource?
One is by:
Me.cboState.DataBindings.Add(New Binding("SelectedValue", Me.AddressRow,
"State"))

Another is by a DataView:
aView = New DataView(dsLookup.States)
With Me.cboState
.DataSource = aView
.DisplayMember = "Description"
.ValueMember = "StateAbbr"
End With

Look like it works. But sometimes the field gets empty when I click the
fields around. I steped in and couldn't find any codes doing that. So I
suspect it is a binding issue.

Please help.
Thanks in advance.

Li

Jul 21 '05 #1
5 1234
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know if we can add multiple
databindings to a ComboBox. If there is any misunderstanding, please feel
free to let me know.

Yes, we can add different bindings to different properties for a control.
But we can add only one binding for one property. Based on the code you
have provided, it is correct. However, I'm not quite sure what you mean by
"the field gets empty when I click the fields around". Could you explain it
a little bit more? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi, Kevin:

After debugging, I found out that after I input something in a text box or
make a selection from a combo box, I click other field. Now the form's
IsDisposed = True and causes all controls' IsDisposed = True. That causes the
fields empty, cursor stuck, etc. But after I click several times, the cursor
moves and everything is ok.

I know it looks weird. But do you have any suggestions about how this may
happen? The form is created as a dialog form.

Thanks.

Li
"Kevin Yu [MSFT]" wrote:
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know if we can add multiple
databindings to a ComboBox. If there is any misunderstanding, please feel
free to let me know.

Yes, we can add different bindings to different properties for a control.
But we can add only one binding for one property. Based on the code you
have provided, it is correct. However, I'm not quite sure what you mean by
"the field gets empty when I click the fields around". Could you explain it
a little bit more? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi Li,

This is weird. To make debugging simpler, could you send me a simple
project that can reproduce the problem? I can debug it on my machine and
work it out more quickly. Thank you.

Remove 'online' from the nospam alias is my email.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4
Hi, Kevin:

I couldn't create a sample from our project to reproduce the problem. I
dis-bind the fields to workaround the problem.
Now I have another problem but I will post as another thread to have the
Subject related to the issue.

Thanks.

Li

"Kevin Yu [MSFT]" wrote:
Hi Li,

This is weird. To make debugging simpler, could you send me a simple
project that can reproduce the problem? I can debug it on my machine and
work it out more quickly. Thank you.

Remove 'online' from the nospam alias is my email.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5
Nice to hear that you have found a workaround.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6

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

Similar topics

0
by: Fernb2000 | last post by:
Hello I have a dataset is composed of a table that has a Name and Id colums. I would like to fill the combo box with the List of names from the dataset and I would like the text box to be the id...
1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
0
by: James | last post by:
I have a bound combo using a lookup table which is behaving as expected with the exception of the first record. In the list of rows for my combo, the first is '.'. This is because of another...
6
by: Brian Henry | last post by:
Here's an example of the code.. I have two combo boxes on screen that when one's selection is change the other's items will be updated to reflect the change (based on a relation) Private...
10
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its...
5
by: Li Weng | last post by:
Hi, Is it OK to bind a combo box to more than one datasource? One is by: Me.cboState.DataBindings.Add(New Binding("SelectedValue", Me.AddressRow, "State")) Another is by a DataView: aView =...
3
by: Bill | last post by:
I have what I think should be a simple question regarding a bound combo box. My first table is Dealers: DealerID - primary key DealerName BillToLocation My second table is Locations:...
1
by: =?Utf-8?B?UmVkYmFjaw==?= | last post by:
Hi All, slight problem I hope someone could shed some light on. I am using VS 2005. In a datagridview I have 2 comboboxes that are both bound to a table field called "empCode". This is an...
3
by: jaymaelescent | last post by:
I have been asked by worklace to try and make a database for them, i have some experience but have encountered a problem making user specific reports. I need to make a report based on a person stored...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
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
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
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...

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.