This is a migrated thread and some comments may be shown as answers.

shift-Tab with ProvideCommandsForKey

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 15 May 2013, 07:51 AM
I am trying to use the ProvideCommandsForKey with a GridView to implement an "insert new row logic" when hitting tab on the last (visible) column of the last row.


I am implementing my logic like this

public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
{
    if (key == Key.Tab)
    {
    ...(Insert new row if necessary)
    }
}

The problem is : When I hit shift-Tab (to tab backwards) it fires the Tab key command, The result is that I insert a new row while it wasn't wanted...

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 May 2013, 09:13 AM
Hello,

You should also check if you have pressed the Shift modifier key:

if (e.Key == Key.Tab && Keyboard.Modifiers == ModifierKeys.Shift)
{
}

and cancel the commands to be executed.
 

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Francis
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or