Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug ComboBox - Disabled and Collapsed item can still be selected
4 replies. Latest Post by praveenrangarajan on June 24, 2009.
(0)
Klinger
Participant
1686 points
300 Posts
05-26-2009 1:53 AM |
A disabled combobox item can be selected if you use the arrows.
I tried setting IsEnabled=false and Visibility=Collapsed and still get the same behavior.
I find it to be a bit inconsistent.
If you can not select using the mouse you should not be able to select
using the keyboard either.
I am using Silverlight 3 ( I did not try it on SL 2).
mchlsync
Star
14606 points
2,730 Posts
05-26-2009 5:52 AM |
Why don't you remove those items from combobox instead of disabling them?
05-26-2009 10:09 AM |
For most cases that's what I would do (filtering the source), but I have a specific situation where I don't want to.
The point is that the behavior is inconsistent, if you cannot select using the mouse, you
should not be able to select using the arrows.
leakybagel
Member
20 points
10 Posts
06-03-2009 1:39 PM |
The same functionality appears to exist with Silverlight 2.0 -- you can still select the item by using the keyboard.
It appears that the combobox items need to be declared as ComboBoxItems in order to disable one. I'm binding to a Dictionary<Enum, string> and can't figure out how to find and disable an item in the list.
praveenr...
42 points
14 Posts
06-24-2009 2:02 PM |
Why dont you trigger a selection_Changed, and look for the item's IsEnabled or Collapsed - exit out of the routine if true. My two cents worth solution :D.