I have a screen with two hierarchic grids next to each other. Both grids are in row select mode. I have disabled the row expansion indicators and expanded the whole grid by default (users should not be able to expand/collapse rows/bands)
In row select the left and right key don't have any effect on the navigation. That's why I want to change the focus from the left grid to the right grid when pressing right and vice versa. Just catch the Left and Right keypress in OnKeyDown or OnKeyPress, change the focus, and done... But that doesn't always work. The right key shows no issues. The event gets fired upon each key press. However, the left key only fires an event on rows that have no child rows and/or don't have a parent row. My guess is this has something to do with the ability of collapsing rows (which I don't use).
I know I can use the tab key to change focus, but the users will be using the up/down key navigation a lot, so why not let 'em switch from left to right using these navigation keys too? But with the OnKeyDown/OnKeyPress event not being fired in all cases, it gives an inconsistent behaviour which confuses the users.
My question: Is it possible to disable whatever is causing the left key event not being fired? Is it a property?
Thanks
Infragistics NetAdvantage for .NET 2008 (latest version)
Wow, that's a great workaround. That extra key mapping solves the problem. Thanks.
The bad news, though, is that I should have already been notified of this. I opened a support incident several months ago about this issue. It was later determined to be an actual Infragistics bug so a bug report was created. However, I have never (until you posted this) been informed that there is a workaround, nor have I been updated with the status of my incident. While I'm glad to find out (now) that there is something I can do to deal with this problem, I should have learned about this workaround as soon as it was discovered. If you hadn't posted this, I'd still be in the dark.
Assuming that the bug you are referring to is BR34050, I checked on the status and it has been verified, so it should be making it into the next hotfix. The fix for this particular bug is to add an additional KeyActionMapping:
this.ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Left, UltraGridAction.PrevRow, UltraGridState.Cell | UltraGridState.RowExpandable, UltraGridState.Row | UltraGridState.RowExpanded, SpecialKeys.All, 0));
Keep in mind that this would need to be removed when you get the hotfix, otherwise the action will be executed twice when the conditions are met.
-Matt
Actually, this is a known bug that I found and reported to Infragistics several months ago. Last month, the bug was listed on the Infragistics website as "Fixed - The bug report was confirmed to be a bug and has been fixed by development" and had a state of "Awaiting QA - [The] issue has been fixed by development but still needs to be verified by QA.", but now bugs submitted before July 29th, 2008 are archived. I'm still trying to find out the status of this known issue.
You are probably right, the grid is probably handling the left and/or right arrow keys to expand/collapse the row or maybe navigate to another row. The keyboard behavior of the grid is controlled by the KeyActionMappings collection. So what I would do is loop through this collection and remove any mapping that are using the Left/Right arrow keys.
Be careful when removing items from a collection like this. You can't use a ForEach loop, you should use an iterative loop and go through the collection backward so as not to mess up the indices as you remove items.