PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
VB 2005 Newbie - Binding?
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
VB 2005 Newbie - Binding?
![]() |
VB 2005 Newbie - Binding? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl... > 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 > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl... > 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 > > "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht > news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl... >> 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 >> >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
SJG,
Can you show the binding to your combobox in true code, as you show it now it is absolute no binding. Cor "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl... > 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 > > "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message > news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl... >> 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 >> >> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht >> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> >> >> > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Hi Cor,
How do I do that? "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message news:uNdpZ3EoGHA.4848@TK2MSFTNGP03.phx.gbl... > SJG, > > Can you show the binding to your combobox in true code, as you show it now > it is absolute no binding. > > Cor > > "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht > news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl... >> 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 >> >> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message >> news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht >>> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl... >>>> 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 >>>> >>>> >>> >>> >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
SJG,
I thought that I asked to show you your code you have made now to do the binding? Cor "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht news:ezjW87MoGHA.764@TK2MSFTNGP03.phx.gbl... > Hi Cor, > > How do I do that? > > > "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message > news:uNdpZ3EoGHA.4848@TK2MSFTNGP03.phx.gbl... >> SJG, >> >> Can you show the binding to your combobox in true code, as you show it >> now it is absolute no binding. >> >> Cor >> >> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht >> news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message >>> news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl... >>>> 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 >>>> >>>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht >>>> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl... >>>>> 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 >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

