VB 2005 Newbie - Binding?

  • Thread starter Oh-its-all-gone-wrong
  • Start date
O

Oh-its-all-gone-wrong

Hi All,



Hope everybody is well? I hope you all don`t mind a newbie asking a rather
daft question but here goes. Im using Visual Basic 2005, i`ll try and
explain best I can:



I have a form, on the form is various items. I have a Datagrid which is
bound to a table called ADSL. I also have some text box`s on all bound to
the coloums in the ADSL table. All works great and seem the sync is ok as
when I change the row on the data table the text box`s update to reflect the
move and vise versa. I also have some ComboBox`s which are linked to
separate tables, and the tables are linked by 1 to many relationships.



On my combobox for location I have in my databindings property for example:



SelectedItem: M_BTADSLBindingSource - LocationsID

SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID

Selected Text: MBTAnalogueLinesBindingSource - Number



Then in my forms load_event I have:



Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)

Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)



However when I run my project I only get the first Location showing in the
combobox (This is the first one that is in the database table, dosn`t show
anymore). When I move position in the datagrid is donsn`t change the
Location in the ComboBox to reflect the one for that row in th database,
instead it just sits on the firstone in this case "Witham"



I hope I havn`t confused anyone and that maybe someone could point me in the
right direction?



I could post my project or e-mail it, if somebody would be so kind as to
help?



Many Thanks

SJG
 
C

Cor Ligthert [MVP]

SJG,

Why are you using a DataGrid and Visual Basic 2005. You say you are using a
combobox. I assume that is inside the DataGrid, which is with a DataGridView
a matter of setting properties.

Any reason that you don't use the DataGridView. This takes time to explain
and thinking about past methods.

Cor
 
O

Oh-its-all-gone-wrong

Hi Cor,

No, sorry i think i havn`t explained well enought. I have a Datagrid on my
Form, and the Combo Box`s are outside the Datagrid. They are seperatly on my
form.

Cheers
SJG
 
C

Cor Ligthert [MVP]

SJG,

Can you show the binding to your combobox in true code, as you show it now
it is absolute no binding.

Cor
 
O

Oh-its-all-gone-wrong

Hi Cor,

How do I do that?


Cor Ligthert said:
SJG,

Can you show the binding to your combobox in true code, as you show it now
it is absolute no binding.

Cor
 
C

Cor Ligthert [MVP]

SJG,

I thought that I asked to show you your code you have made now to do the
binding?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top