Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

binding a datagrid column to a textbox 1

Status
Not open for further replies.

NovCoder

Programmer
Jun 3, 2005
8
0
0
US
Hi, I am trying to have a textbox automatically get a value from a query with 4 columns(id, name, title, dept.) everytime a combobox text changes via:

Private Sub cboLiaison_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

me.txtDept.DataBindings.Add("text", DsEmployee.v_DDCemployee, "Department")


End Sub

This does not work, neither does my previous methods. PLEASE HELP.THANK YOU.

...and I'm out. O-BOY.
 
Hello,

You should only have to set your textbox binding once, maybe in form load code. Try this:
Code:
me.txtDept.DataBindings.Add("text", DsEmployee.v_DDCemployee, "Text")
You want to bind your textbox Text property to the ComboBoxes Text property. The above assumes that the middle part of your expression is actually a DataTable or a DataView. Good Luck!


Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top