Avatar of richard_exchange
richard_exchangeFlag for Austria asked on

Silverlight - how to use keyboard with custom control check combobox

Hello,

i have made a custom control which is a combobox with checkboxes as items (multiple selects possible).
How is it possible to use the keyboard (arrow up/down and space) within this custom control.
My control has the base class "control".
Inside it there is the private Combobox with a Templatebinding...

 

The data is bound dynamicaly to the ItemsSource of the combobox via a DependencyProperty and the private list "dataList".

 

All works well but the keyboard does not as expected!?!?!
I want to move with the cursors and select/deselect the checkboxes with the space key.
Please help me!
Web Components.NET ProgrammingC#

Avatar of undefined
Last Comment
richard_exchange

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
karthika_cts

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
richard_exchange

Hello karthika,

to derive directly from ComboBox class hmm...no i haven't.
I give it a try and come back with results...
ASKER
richard_exchange

Hello karthika,

no, it works the same like my keyhandler (this.CCBox.KeyUp += new KeyEventHandler(CCBox_KeyUp);)...

I think the problem are the checkboxes in the itemslist...
The event does only fire if i select a checkbox, but then the selection bar does not move.
If i click beside the text of the checkbox, the event does not fire but the selection bar moves.
The scrolling of the items does also not work, the bar moves out of the visible area but there is no scrolling...
ASKER
richard_exchange

Finally i have solved my problem.

I have override the keyhandler on the comboboxitem itself.
This way a get the key events i need and can handle it.

Additionally i hade to derive my class from ComboBox   -> Points goes to karthika.

Thanks.

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck