I would like to know if the user is navigating around in my grid either by tab or enter or clicking. I am a little frustrated that it seems like the tab or enter key isn't firing keydown event. Am I missing something, or is this as designed. I don't plan on trying to 'handle' those key strokes, just set a boolean.
Hello Alan,
I have been looking into your post and it seems that this event is handled internally in the code of the control in order to execute the functionality that it presents. This is the reason why when you enter ‘Tab’ button nothing happens. When I tested it for ‘Enter’ everything goes right.
If you have any other questions on this matter, feel free to ask.
Hey Yanko,
I figured out a work-around to my issue in the meantime. In the event of the enter key testing that you did, which event fires first, exitedEditMode, or Keydown?
Thank you for your feedback. If you need any further assitance on this matter in future, please do not hesitate to contact us.
No, I have had to put this on the shelf for a while and I will return to this later.
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
I have been looking into your last post and I have been trying to reproduce your issue without success. In the both variants when the focus is on the last cell of the XamGrid and I press the ‘Tab’ button, the focus goes to the next control, defined in the Grid panel. I am sending the sample application that I have used. If I have misunderstood you in any way, please modify the application in order to meet your scenario.
Looking forward to hearing from you.
I suppose not. But I will tell you something I noticed about keypress event which I thought was odd.
Let's say you define a grid with fixed width columns. But you don't set an overall width for the grid. Depending on how you position the grid within a xaml grid, it could render with this extra space at the right of the last column that you can't tab into. It's like dead space. On keypress event, If you check what kind of object has focus when you tab out of the last cell of that row, you will notice that focus is still on a cell object. Maybe even the cell object that you can't tab into.
However, if on the same grid you define a fixed width for the grid (in addition to defining fixed width on the columns) and again check for who has focus on keypress of a tab from the last cell, you will notice that focus has switched to another control on your form. I found this most annoying behavior because of how I am allowing user to navigate through the cells by using the enter key or tab key, I had to check what has focus to determine if I needed to end edit on the grid or not. So, if I fix the width of the grid, I get the wrong behavior for what I want. It was quite puzzling as to what about the fixed width caused the answer to "What has focus?" to change.