<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
<telerik:RadAjaxManager ID="ram1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="rgT"> rgT is my new grid
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="txW"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="txW" runat="server" style="display:none;" Behavior="Default" Height="300px" InitialBehavior="None" Left="" Modal="True" NavigateUrl="PurchaseCardUseTax.aspx" OpenerElementID="rgT" Skin="WebBlue" Top="" Width="400px" Title="Use Tax">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<telerik:GridTemplateColumn DataField="USE_TAX_AMT" HeaderText="Use Tax" UniqueName="USE_TAX_AMT"
AllowFiltering="False">
<HeaderStyle HorizontalAlign="Left" Width="45px" Wrap="False" />
<ItemStyle HorizontalAlign="Right" Width="45px" Wrap="False" />
<ItemTemplate>
<asp:LinkButton ID="lbUseTax" runat="server" Width="45px" CssClass="Normal" OnCommand="useTaxClick"
ToolTip="Click to edit use Tax" Text='<%#DataBinder.Eval(Container, "DataItem.USE_TAX_AMT") %>'></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
Public
Sub useTaxClick(ByVal sender As Object, ByVal e As CommandEventArgs)
'Open up the rad window that allows editing of the Use Tax
txW.Behaviors = WindowBehaviors.Close
Or WindowBehaviors.Move
txW.NavigateUrl =
"MyWindow.aspx"
txW.VisibleOnPageLoad =
True
End Sub