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

[Solved] Edit Keyboard-Navigation Questuions

4 Answers 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Geoff Davis
Top achievements
Rank 1
Geoff Davis asked on 26 Feb 2010, 09:58 PM
As a general question, I was wondering if there was any support for vertical (up / down) keyboard navigation while in edit mode?

We are using a RadGridView as an entry form for a fairly large number of records, and this would be incredibly useful as only one or two editable fields will be changed in the majority of cases. 

The sticking point, though, is my other question:

Is it possible to exclude cells or rows from tab-navigation?

After each block of 1-3 records, we have a 'new line' item whose data is formatted to show a blank line. This is working perfectly as far as adding new items is concerned, but if a user is in edit mode, tabbing through cells to update data, they would presently tab into the new row and be forced to exit edit mode in order to get past the blank line. Is there a tab-navigation event that can be caught, or a property that can be set in order to correct or prevent this situation?

Thanks,
Geoff

4 Answers, 1 is accepted

Sort by
0
Geoff Davis
Top achievements
Rank 1
answered on 02 Mar 2010, 03:06 PM
Skipping lines while tab-navigating was simpler than I thought it would be - just attach a keyboard handler to the GridView, making sure to catch handled events for tab, and just logic it down from there.

I haven't implemented up / down navigation yet, but I don't see a reason that shouldn't be just as straight forward.


Geoff
0
Nedyalko Nikolov
Telerik team
answered on 04 Mar 2010, 08:42 AM
Hello Geoff Davis,

Generally with the current version of RadGridView there is no way to customize the behavior of any key, because RadGridView handles key down event. With the new version (2010.Q1) we are going to introduce a new property called KeyboardCommandProvider which can be used to override the default keyboard behavior. I'm attaching a sample project that demonstrates how to customize "Enter" key. Take a look at "CustomKeyboardProvider" class and its usage.
Let me know how this works on your end.

P.S. In order to compile the example just add references to 2010.Q1 beta binaries (available in your Client account).

Kind regards,
Nedyalko Nikolov
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.
0
Matt
Top achievements
Rank 2
answered on 03 Feb 2011, 05:00 PM
I have had pretty solid success overriding
<FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 
face=Consolas><FONT color=#2b91af size=2 
face=Consolas>DefaultKeyboardCommandProvider </FONT></FONT></FONT>
and have accomplished the functionality required for my project.  However our project is MVVM and when trying to databind this property on the RadGridView I recieve an error at binding time.  The error indicates a type cast exception, if I had to guess this property is not implemented as a dependency property? 

Is there any way to databind this property?  I would prefer to adhere to MVVM when using this control.
0
Nedyalko Nikolov
Telerik team
answered on 08 Feb 2011, 02:42 PM
Hello Geoff Davis,

Indeed RadGridView.KeyboardCommandProvider property is not a DependencyProperty. The reason for that is that DefaultKeyboardCommandProvider has no public parameterless constructor and this prevents the default usage of this feature (to inherit from DefaultKeyboardCommandProvider class and change only one key behavior).
Let me know if there is something unclear.

Regards,
Nedyalko Nikolov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Geoff Davis
Top achievements
Rank 1
Answers by
Geoff Davis
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Matt
Top achievements
Rank 2
Share this question
or