Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4007548
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:38:44+00:00 2026-05-20T08:38:44+00:00

My app has a datagrid as well as many other UIComponents (buttons, menus, etc).

  • 0

My app has a datagrid as well as many other UIComponents (buttons, menus, etc). I have a general stage KeyDown handler as well as a specific one for the datagrid. The behavior I’m trying to implement is turning out to be trickier than I thought: basically, when using the keyboard arrows I would like the datagrid to always hear about such commands, even if it’s not in focus.

Possible approaches I thought of:

  • have the DG be in focus at all times: seems stupid / tricky – basically would need to remember to give focus back to DG after any interaction with the rest of the UI, which obviously doesn’t scale.

  • try to set the DG in focus from stage KeyDown handler: seems like the timing doesn’t work since the DG gets focus too late to “hear” the event.

  • from the stage keydown handler, check if the DG is not in focus, and if so pass it the event. This seems to make sense in theory, but I’m not sure how to do this properly since my stage keyDown handler uses capture, and thus seems to catch the same event over and over.

I’m wondering if there’s something much simpler that I’m simply missing due to inexperience. Would love to hear any of your thoughts.

thank you!

f

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:38:44+00:00Added an answer on May 20, 2026 at 8:38 am

    I would go with the third option, passing the stage keydown event to the DataGrid… But only if the event’s default action hasn’t been prevented. Then simply event.preventDefault() in the DataGrid handler and you should be good to go.

    For example:

    stage.addEventListener(..., function(event:KeyboardEvent):void {
        if (event.isDefaultPrevented())
            return;
        dataGrid.dispatchEvent(event);
    });
    
    dataGrid.addEventListener(..., function(event:KeyboardEvent):void {
        event.preventDefault();
        ... handle event ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app has several buttons which trigger different events. The user should NOT be
I have a HyperLinkButton in every row of a datagrid in my silverlight app.
My app has very different UI structures for each orientation. At what stage in
In my WPF app, I have a datagrid with a IntegerUpDown control displayed in
My app has a few activities, all have an options menu, which is the
My app has been running fine on iPhone simulator. I have hit an issue
I have a .NET windows app. I have a DataGridView which has a few
I have a Windows Forms app, that has a single ElementHost containing a WPF
My app has many controls on its surface, and more are added dynamically at
My app has a session timeout after 30 minutes. If the user has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.