
<PagerTemplate>
<table>
<tr>
<td>
<asp:Button ID="btn1" runat="server" Text="Approve" />
</td>
</tr>
</table>
</PagerTemplate>
</telerik:RadGrid>
I m trying to do below manner, but won't able to capture button click event, please help
protected
void grdADInbox_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridPagerItem)
{
GridPagerItem item = (GridPagerItem) e.Item;
Button btn = item.FindControl("btnFutureApprovals") as Button;
switch (btnFutureApprovals.Text)
{
case "Future Approvals":
btnFutureApprovals.Text =
"Current Approvals";
break;
case "Current Approvals":
btnFutureApprovals.Text =
"Future Approvals";
break;
}
}
}
I'm not sure if this is related just to jQuery, or if there is an issue with the Telerik version thereof.
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> |
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> |
| function KeyPressed(ctrl, e) { |
| if (e.get_domEvent().rawEvent.keyCode == 13) { |
| var ID = ctrl.get_id(); |
| var ctrl; |
| if (ID.indexOf("F1") >= 0) ctrl = $find("<%= F2.ClientID %>"); |
| if (ID.indexOf("F2") >= 0) ctrl = $("#<%= C1.ClientID %>"); // fail |
| // $find("<%= C1.ClientID %>"); // this didn't work either |
| if (ctrl !== null) { |
| e.set_cancel(true); |
| setTimeout(function() { ctrl.focus(); }, 1); |
| } |
| ... |
| } |
| } |
| <telerik:RadNumericTextBox ID="F1" Width="80px" runat="server" |
| Type="Number" NumberFormat-DecimalDigits="0" ClientEvents-OnKeyPress="KeyPressed" /> |
| ... |
| <telerik:RadNumericTextBox ID="F2" Width="80px" runat="server" |
| Type="Number" NumberFormat-DecimalDigits="0" ClientEvents-OnKeyPress="KeyPressed" /> |
| ... |
| <asp:CheckBox ID="C1" runat="server" Text="Check Me!" /> |