To set up a ReadOnly ComboBox
in XAML (WPF), you have to set up a ComboBox
and a TextBox
showing only one of them according to a pair of properties IsReadOnly
/IsEditable
that must exist on your ViewModel
. Note that on this sample "UserNVL
" must exist in the resources and it should be a NameValueList
collection that allows us to convert ID
to names. In this case the RecipientID
is the key for a user name. Note also the VisibilityConverter
must also exist in the resources and it's a standard BooleanToVisibilityConverter
.
Gosh! This was so hard to find I had to made it myself. This allows the user the select the content of the text box. No way a disabled ComboBox
would ever allow you to do it.
There are two properties named IsHitTestVisible & IsTabVisible. the former makes the control deaf to mouse events and the latter to keyboard events. This could help you as it would not give the disabled look to your combo box but you will succeed in making a read only combo box.. Source :- http://www.telerik.com/community/forums/wpf/combobox/isreadonly-does-seem-to-work.aspx
Why not just set IsEnabled=false?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With