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

map keyboard support of radgrid for enter key to open radwindow rather than postback

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 22 Aug 2008, 01:12 AM
 

I have a template column with an image button that when clicked opens a radwindow through javascipt to edit an item in the grid.  This proces works well.

<telerik:GridTemplateColumn

UniqueName="TemplateEditColumn"

HeaderText="View/Edit"

HeaderStyle-Width="100">

<ItemTemplate>

<asp:ImageButton ID="EditButton" OnClientClick='<%# Eval("ID", "openEditCommentWindow({0}); return false;" ) %>' runat="server" ImageUrl="./images/edit.gif"></asp:ImageButton>

</ItemTemplate></telerik:GridTemplateColumn>


this is the jascript that it calls:

function openEditCommentWindow(CommentID)

{

var oWnd = radopen("CommentDetail.aspx?CommentID=" + CommentID, "Edit Comment");

oWnd.set_modal(

true);

oWnd.Center();

}

So my issue is that I am trying to build an application to minimize mouse use and generally use the keyboard support of the grid to place the grid into edit mode by setting

ClientSettings-AllowKeyboardNavigation
="true"

whihc is a relly nice feature.

The problem is that pressing the enter key while having a row selected causes a postback to the  radGridComments_ItemCommand rather than opening a client side radwindow.

How can I hook up the enter key to the openEditCommentWindow javascript function?

Thanks much

Jonathan 

1 Answer, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 22 Aug 2008, 01:29 AM
Looks like I can figure it out from here:

http://www.telerik.com/community/forums/thread/b311D-tekma.aspx

Cheers
Tags
Grid
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Share this question
or