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

[Solved] Grid Keyboard Navigation

3 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 20 Jul 2009, 06:34 PM
Ok, this might be a serious problem, if there is not another setting that works with it...
(Don't you hate when people start off posts that way!!! :))

If I set Keyboard navigation to true for a grid.  If I hit the enter key, the row I am on goes into edit mode, whether I allow editing or not.  While I like the keyboard navigation feature, this is not good.

The grid I am using is a display grid only.  I have EnabledPostBackOnRowClick=true. When a user clicks on a row, an ajax request is done updating a seperate area that is used for data editing.  This works fine with mouse navigation, but with keyboard navigation, I assumed hitting enter would act as a mouse click triggering the same functionality.  I was wrong, and this happens even with AllowAutomaticInserts/Deletes/Updates set to false.

Now, since the data in the grid is a query, and cannot tie directly back to the data, an update can't occur, but you can see the problem.

Comments?  (I'm hoping there is just an additional setting I'm missing!)

Thanks, Kuba

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 23 Jul 2009, 10:33 AM
Hi Kuba,

There is no single property with which to prevent the Grid form entering Edit mode. One possible approach is to simply cancel the Edit command with the ItemCommand server-side event handler like this:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    if (e.CommandName == "Edit"
    { 
        e.Canceled = true
    } 

Alternatively if you want to allow the command to be executed under some condition you can make a similar cancellation on the client. I hope this helps.

Greetings,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
George
Top achievements
Rank 1
answered on 28 Jul 2009, 04:03 AM
Hi Pavel,

Yes, I have already done something like this to prevent the edit.  My problem here is that is shouldn't happen at all.  If, for example, I have a grid that does no editing whatsoever, but is simply a look-up list, in which selecting a row, provides more information, somewhere else on a page, than the edit function shouldn't be accessible.  Which it isn't, unless keyboard navigation is enabled.  (Without doing a code-hack to prevent it).

I believe this is a bug that should be handled with a property related to keyboard navigation.

Perhaps I'm wrong about this, can you tell me why this wouldn't be considered a bug?

Thanks,
Kuba
0
Pavel
Telerik team
answered on 29 Jul 2009, 06:49 AM
Hello Kuba,

Since there is no singe property that enables or disables the Editing feature this is the expected behavior when keyboard navigation is enabled. I have consulted with our developers on this issue and we might include a property which will disable all features except the navigation itself (we already have a property to disable selection so this will not change), which I think meets your requirements. The issue is now logged in our system. I have updated your Telerik points for your feedback.

All the best,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Pavel
Telerik team
George
Top achievements
Rank 1
Share this question
or