Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1080
KeyUp and PreviewKeyUp events not fired in TextEditorTool
posted

I'm developing an application with a ribbon bar. One of the tools in the ribbon is a search text field (a TextEditorTool object). Next to the the search field there is a search button. Below the ribbon there is a xamDataGrid.
So the idea is that you can filter the data in the grid by entering a string into the TextEditorTool and the press the search button. My customer thought that that instead of pressing the search key it would be more convenient just to press the enter key.

Nothing simpler than that! I just implemented the PreviewKeyUp Event of the TextEditorTool and tested e.Key against Key.Enter. Unfortunately it just doesn't work. I tried lots of potential workarounds but could not make it work.

What could be the problem?

Best Regards

Markus

P.S. I've attached a sample application that illustrates the problem.

VSS2XGUI_TEST.zip
Parents
No Data
Reply
  • 280
    Offline posted

    I can confirm this. I also tried fetching the Key.Enter in surrounding Controls, like RibbonTabItem and RibbonGroup. The Key.Enter never reaches those events and i see no option to "enable" the TextEditorTool to recognize the Key.Enter.

    The only way to get around this seems to use a standard TextBox for this purpose. I use this also for a way to let the user enter a Search Term and hit the enter key in order to not click a button with the mouse.

Children