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

DataBinding and Combo Boxes

P: n/a
I am trying to create a form using databinding to a dataset and one of the
fields requires the user to select from a list of optons. Any hints on how
to do this other than bind the field to a label or text box to display the
current field value then add a combo box with the list of items to chose from?

--
Dennis in Houston
Mar 29 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I'm sorry but I don't quite understand the question. Could you reword
it please, and I will do my best to answer it.

(for standard binding to a combobox, known as "complex binding" for
some bizarre reason...)

mycombo.datasource = myDataTable ' or, myDataset.Tables(0) or
myDataset.Tables("tablename")
mycombo.DisplayMember = "DisplayField" ' whichever column you want
to display in the combobox
mycombo.ValueMember = "IDField" ' whichever column is the
uniquely identifying column in a row.

Mar 29 '06 #2

P: n/a
Dennis,

As Steven told, give us some more information, from this I cannot get only
gues.

As we are talking about databinding, than the datasource is important
(bindingsource whatever).

As well the properties we want to bind to. For about what you are talking is
probably the dataview your first friend.

Cor
"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:88**********************************@microsof t.com...
I am trying to create a form using databinding to a dataset and one of the
fields requires the user to select from a list of optons. Any hints on
how
to do this other than bind the field to a label or text box to display the
current field value then add a combo box with the list of items to chose
from?

--
Dennis in Houston

Mar 29 '06 #3

P: n/a
I have a form that is bound to a dataset. On it, there are some text box
controls and also a combo box that I want to display the current dataset row
fields and let the user edit then save to the current dataset row being
displayed.

For the combo box, I want to display the current value of the field in the
current DataSet Row and allow the user to change it by selecting a new value
from a drop down list. I can add the allowable values to the combobox but
can't seem to get the combobox to show the current field value using
databinding.

--
Dennis in Houston
"Cor Ligthert [MVP]" wrote:
Dennis,

As Steven told, give us some more information, from this I cannot get only
gues.

As we are talking about databinding, than the datasource is important
(bindingsource whatever).

As well the properties we want to bind to. For about what you are talking is
probably the dataview your first friend.

Cor
"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:88**********************************@microsof t.com...
I am trying to create a form using databinding to a dataset and one of the
fields requires the user to select from a list of optons. Any hints on
how
to do this other than bind the field to a label or text box to display the
current field value then add a combo box with the list of items to chose
from?

--
Dennis in Houston


Mar 30 '06 #4

P: n/a
Dennis,

This sample is with a datagrid, (mainly to show the different ways of
databinding) however it is mainly the same. As soon as you have databind
something it is sticked to the current row.
If you want to let them work independent, than you have to create seperate
dataviews.

http://www.vb-tips.com/default.aspx?...f-587f730fa118

A problem is that using the combobox textbox for operations seems for me one
chain of bugs.
I reported lately one for 2005.

Also I have posted in past those in different newsgroups to see a reaction.
I got the idea than the Combobox problems are a plague I have never got any
reaction.

However, I hope this helps, and otherwise reply.

Cor

"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:44**********************************@microsof t.com...
I have a form that is bound to a dataset. On it, there are some text box
controls and also a combo box that I want to display the current dataset
row
fields and let the user edit then save to the current dataset row being
displayed.

For the combo box, I want to display the current value of the field in the
current DataSet Row and allow the user to change it by selecting a new
value
from a drop down list. I can add the allowable values to the combobox but
can't seem to get the combobox to show the current field value using
databinding.

--
Dennis in Houston
"Cor Ligthert [MVP]" wrote:
Dennis,

As Steven told, give us some more information, from this I cannot get
only
gues.

As we are talking about databinding, than the datasource is important
(bindingsource whatever).

As well the properties we want to bind to. For about what you are talking
is
probably the dataview your first friend.

Cor
"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:88**********************************@microsof t.com...
>I am trying to create a form using databinding to a dataset and one of
>the
> fields requires the user to select from a list of optons. Any hints on
> how
> to do this other than bind the field to a label or text box to display
> the
> current field value then add a combo box with the list of items to
> chose
> from?
>
> --
> Dennis in Houston


Mar 30 '06 #5

P: n/a
Thanks Cor. I suspected that it wasn't that easy to do with a dataset.
--
Dennis in Houston
"Cor Ligthert [MVP]" wrote:
Dennis,

This sample is with a datagrid, (mainly to show the different ways of
databinding) however it is mainly the same. As soon as you have databind
something it is sticked to the current row.
If you want to let them work independent, than you have to create seperate
dataviews.

http://www.vb-tips.com/default.aspx?...f-587f730fa118

A problem is that using the combobox textbox for operations seems for me one
chain of bugs.
I reported lately one for 2005.

Also I have posted in past those in different newsgroups to see a reaction.
I got the idea than the Combobox problems are a plague I have never got any
reaction.

However, I hope this helps, and otherwise reply.

Cor

"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:44**********************************@microsof t.com...
I have a form that is bound to a dataset. On it, there are some text box
controls and also a combo box that I want to display the current dataset
row
fields and let the user edit then save to the current dataset row being
displayed.

For the combo box, I want to display the current value of the field in the
current DataSet Row and allow the user to change it by selecting a new
value
from a drop down list. I can add the allowable values to the combobox but
can't seem to get the combobox to show the current field value using
databinding.

--
Dennis in Houston
"Cor Ligthert [MVP]" wrote:
Dennis,

As Steven told, give us some more information, from this I cannot get
only
gues.

As we are talking about databinding, than the datasource is important
(bindingsource whatever).

As well the properties we want to bind to. For about what you are talking
is
probably the dataview your first friend.

Cor
"Dennis" <De****@discussions.microsoft.com> schreef in bericht
news:88**********************************@microsof t.com...
>I am trying to create a form using databinding to a dataset and one of
>the
> fields requires the user to select from a list of optons. Any hints on
> how
> to do this other than bind the field to a label or text box to display
> the
> current field value then add a combo box with the list of items to
> chose
> from?
>
> --
> Dennis in Houston


Mar 31 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.