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

DataBindings problem

Al
I'm trying to use ComboBox on Windows Form.
I create and set DataBinding and DataTable objects
I create a couple of Procedures:

Private Sub ClearBindings()
cbTakeOffPerson.DataBindings.Clear()
End Sub

Private Sub SetBindings()
With cbTakeOffPerson
.DataBindings.Add("SelectedValue", bdsJob, "TakeOffPersonID")
.DataSource = dtSalesman
.DisplayMember = "Salesman"
.ValueMember = "SalesmanID"
End With
End Sub

In Form_Load event I call both procedures. Although TakeOffPersonID in
bdsJob (DataBinding object) is not set to the first record in DataTable I
get the first Salesman in ComboBox. When I move through records, everything
starts to work properly. If I call both procedures twice then even after
form loads everything works.

What am I missing?

Al
Aug 2 '06 #1
0 811

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

Similar topics

0
by: akadiri4 | last post by:
I am trying to bind a textbox to a dataset using VB.Net but it doesn't seem to work Here is the code: DS = New DataSet DA = New SqlDataAdapter(StrSQL, StrConn) DA.Fill(DS, "StrSQL")...
0
by: Damien Sawyer | last post by:
Hi all, I have a series of checkboxes that I've bound to objects using checkbox.databindings.add. The problem is that it appears that the checkboxes only update the underlying object when...
9
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to...
2
by: Martin Horn | last post by:
Hi, I want to use databinding on a property for a class that I have created, but I can't make it work. Below is a contrived example to illustrate the problem. It seems that I can't databind...
2
by: C Glenn | last post by:
This is admitedly vague. But so is my understanding of the problem. I'm using this chunk of code: retControl.DataBindings.Add(ctrlBinding.PropertyName,DataSource,BindingField); This resolves...
1
by: Tom Scales | last post by:
OK, this one has me stumped. I am reading XML into a Dataset and then binding values to a label control. When displayed on the screen, the label control has the correct value in it. When I...
0
by: XenReborn | last post by:
Ok this should be simple. I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database,...
2
by: marcf | last post by:
Hi everyone, I've just studio using VS2008 and have a quick question regarding databindings, i'm fairly handy with vb6 so this question really relates to good practice rather than actual coding. ...
1
by: janj | last post by:
Hi all, I'm having a problem binding two object properties to properties of another object. The code below works as expected when only one binding is added but doesn't work at all (still compiles)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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,...
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...

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.