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

Limiting a Bound ComboBox List Items

P: n/a
I have databound a Windows form ComboBox control to a DataSource and
DataMember and it is properly showing the data as I navigate through
the records. My question concerns the choices in the pull-down list
itself.

The Field is Priority and the only available choices should be "High",
"Low", "Do Not Call".

These are the only choices I would like to see in drop-down, but
because it is bound to the column it is showing multiple instances of
each (based on the column it is tied to).

Question: How can data bind a combobox to a datacolumn, but still
retain control of what choices are available from the drop-down list.
(only one of each)

Thanks,

Apr 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can ensure that there are no duplicates in the data source.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

<gl******@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
>I have databound a Windows form ComboBox control to a DataSource and
DataMember and it is properly showing the data as I navigate through
the records. My question concerns the choices in the pull-down list
itself.

The Field is Priority and the only available choices should be "High",
"Low", "Do Not Call".

These are the only choices I would like to see in drop-down, but
because it is bound to the column it is showing multiple instances of
each (based on the column it is tied to).

Question: How can data bind a combobox to a datacolumn, but still
retain control of what choices are available from the drop-down list.
(only one of each)

Thanks,

Apr 17 '07 #2

P: n/a
Do you mean that you are navigating through a dataset, and you are using
the column in the dataset itself to do the binding for the combobox?

If that is the case, you need to bind your database to a list containing
just the values you want displayed. Note that if you do this, when you
cross a record where the value is in your form's dataset but not in the
dropdown, the field will display as a blank. To get around that, you can
set it to a dropdown combobox, not a dropdown list, and load a list of
values directly into the combobox instead of binding it.

Robin S.
---------------------------
<gl******@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
>I have databound a Windows form ComboBox control to a DataSource and
DataMember and it is properly showing the data as I navigate through
the records. My question concerns the choices in the pull-down list
itself.

The Field is Priority and the only available choices should be "High",
"Low", "Do Not Call".

These are the only choices I would like to see in drop-down, but
because it is bound to the column it is showing multiple instances of
each (based on the column it is tied to).

Question: How can data bind a combobox to a datacolumn, but still
retain control of what choices are available from the drop-down list.
(only one of each)

Thanks,

Apr 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.