-
March 9th, 2012, 09:17 PM
#1
Hiding combo box items
I have 2 different systems a user can choose from. The same screen appears no matter whether the user selects system 1 or 2. However, there is a drop down Item combo box that has 16 items, each numbered 1-16. However, 1-16 should only appear if system 2 is selected. If system 1 is selected, only items 1-5 should appear. I can use IsEnabled, but that doesn't collapse or hide the last 11 items. Is there a way to hide items 6-16 instead of making them just unselectable?
-
March 9th, 2012, 09:28 PM
#2
Re: Hiding combo box items
You can empty the combobox and then refill it with only those items required (or just remove/add the last 11 items via the Items property), when your "system" changes. Or you could use two different combo boxes, showing only one at a time (in the same location). If you use binding, you could also create two item collections, and rebind as necessary.
It would help if you showed some code. And provided additional information.
Is this Windows Forms? WPF? What?
-
March 9th, 2012, 09:50 PM
#3
Re: Hiding combo box items
Thanks for the options. I'm using WPF to define the combo box.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|