combobox / datagridcomboboxcolumn disable or hide items

By rsimlote ·
I have a winform with some comboboxes and datagrids with
datagridcomboboxcolums. I am binding these comboboxes with data from
the database table. Over time some of the items can be inactivated
from the list. The problem is that forms that items that are
inactivated already selected when they were active.
How can I display items that are inactivated, but prevent user from
selecting those items.
Thank you

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

You are giving yourself a raft of problems by

by Tony Hopkinson In reply to combobox / datagridcombo ...

trying to use combobox for something it wasn't really designed for. The items in the list are by definition available.

Now you could overide the paint mechanism so you could show unavailable in say grey, you could overide the selection process to ignore the selection of an unavailable item.
You could write the code to deal with a once available selection becoming unavailable.

The question is, is this really wise ?

The fact that the control is also databound is going to maginify your problems as well. As soon as you want nonstandard behaviour the binding mechanism will get right in your face, from the get go.

Related Discussions

Related Forums