By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

'Nother, larger binding problem

P: n/a
OK, so in addition to the problem I mentioned before (c.f. "Data Binding to
Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect whatever
the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which is
filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full of
bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly typed
dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 20 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Peter,

Databinding is very simple, let say you want to bind a textbox to a combobox
both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earthl ink.net...
OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full
of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly typed
dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 20 '07 #2

P: n/a
That type of data binding is indeed simple.

But I don't have any idea where to start with a more complex question such
as what I'm trying to do... i.e. have the row to which my controls are bound
change based on the user's row selection in a listbox. Can you give me an
equally simple line of code that will do that?

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Peter,

Databinding is very simple, let say you want to bind a textbox to a
combobox both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earthl ink.net...
>OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full
of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly
typed dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 21 '07 #3

P: n/a
This is of the same simplisity

http://www.vb-tips.com/dbpages.aspx?...8-4e3f3fedb997

Cor

"Peter" <st*****@hotmail.comschreef in bericht
news:LV*****************@newsread2.news.pas.earthl ink.net...
That type of data binding is indeed simple.

But I don't have any idea where to start with a more complex question such
as what I'm trying to do... i.e. have the row to which my controls are
bound change based on the user's row selection in a listbox. Can you give
me an equally simple line of code that will do that?

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Peter,

Databinding is very simple, let say you want to bind a textbox to a
combobox both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text ")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earth link.net...
>>OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also
full of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly
typed dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.


Apr 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.