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

Tab Key Deselects my selected rows

1 Answer 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chet Watkins
Top achievements
Rank 1
Chet Watkins asked on 17 Jun 2010, 01:55 PM
I have a gridview that is using the selection checkbox column. The problem we are running into is that if someones selects rows with the checkboxes, then hits tab, the tab key will cause the row in focus to check (if not checked) and unselect all the other rows. Is there a way to disable this from happening?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 23 Jun 2010, 08:58 AM
Hello Chet Watkins,

First of all, please excuse me for the delay.
The default behavior of the Tab key is to perform the commands RadGridViewCommands.MoveNext and RadGridViewCommands.SelectCurrentItem. The result is that all selected items are deselected, leaving only the CurrentItem selected. In order to change that you need to create additional class in our project - CustomKeyboardCommandProvider and to predefine that behavior as follows:

public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
        {
            List<ICommand> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
            if (key == Key.Tab)
            {              
                commandsToExecute.Remove(RadGridViewCommands.SelectCurrentItem);               
            }
            return commandsToExecute;
        }

Furthermore, you need to set the Property of the grid - IsSynchronizedWithCurrentItem to "false".
I am sending you a sample project so that you can see and test the proposed solution.

Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Chet Watkins
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or