combobox - Easy way to make Silverlight combo boxes perform like HTML select boxes? -
I am quite new to the serial but I am experienced in web development, and I am feeling very angry with Silverlight's default cobobox. It seems that there is a lack of any concept of use for regular data entry. Mainly I would like it to function like a HTML selection box, where you can press the drop down, then type a letter and it takes you to the first item with that letter
Thank you
You can write the attached behavior to provide this functionality. The problem is that the items in the combo box
in Silverlight are not always wired, they can have full control that the user has templates in the form of the ItemTemplate
. If you know that you are going to be string
, then you have to attach to the KeyDown event by Behavior & lt; ComboBox & gt;
can apply and select the correct one.
Public Class HTMLSelectBehavior: Behavior & lt; ComboBox & gt; {Secure Override Zero Current () (AssociatedObject.KeyDown + = OnKeyDown;} Private Zero OkayDown (Object Sender, KAntAgages E) {Selected ETOM = Associated Object. Items Source. FirstOrDefault (i = & gt; i.ToString (). It is not far from the top of my head, so it is not perfect and definitely there is a lack of many security checks, But it should give you an idea.