<telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Download" CommandName="Download" Text="Download"></telerik:GridButtonColumn>
In the AJAX Manager:<
ClientEvents OnRequestStart="mngRequestStarted" />
Client side java script<script type="text/javascript">
function mngRequestStarted(ajaxManager, eventArgs)
{
var re = new RegExp("\.DownloadButton$","ig");
if (eventArgs.EventTarget.match(re))
{
eventArgs.EnableAjax = false;
}
}
</script>
Everything seems to work except the regular expression check. I was hoping that the button controls would be named DownloadButton* (based on the UniqueName), but instead they are named like clt00$ContentPlaceHolder1$RadGrid1$ctl00$ctl04$ctl00. Any suggestions on how I can make this work? Thanks.
| <%@ Control Language="VB" AutoEventWireup="false" CodeFile="leftPowerPAD.ascx.vb" Inherits="controls_leftPowerPAD" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <telerik:RadAjaxPanel ID="RAPPowPad" runat="server"> |
| <div id="areaPwrPadLists"> |
| <table cellpadding="0" cellspacing="0"> |
| <tr> |
| <td> |
| <asp:DropDownList ID="DropDownList1" runat="server" CssClass="dropListA"> |
| <asp:ListItem Selected="True" Value="0">-- Select List--</asp:ListItem> |
| </asp:DropDownList> |
| </td> |
| <td> </td> |
| <td valign="middle"> |
| <asp:ImageButton ID="ImageButton13" runat="server" |
| ImageUrl="~/images/buttonPPGo.gif" /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <table border="0" cellpadding="0" cellspacing="0" class="tblPowerPad"> |
| <tr> |
| <td class="cellPowerPadHead">JS Order #</td> |
| <td class="cellPowerPadHead">Qty</td> |
| <td> </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox1" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox2" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton3" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox3" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox4" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton4" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox5" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox6" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton5" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox7" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox8" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton9" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox9" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox10" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton6" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox11" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox12" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton7" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox13" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox14" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton8" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox15" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox16" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton10" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox17" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox18" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton11" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| <tr> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox19" CssClass="inputA" Width="155px" runat="server" /> |
| </td> |
| <td class="cellPowerPadInput"> |
| <asp:TextBox ID="TextBox20" CssClass="inputA" Width="25px" runat="server" /> |
| </td> |
| <td> |
| <asp:ImageButton ID="ImageButton12" runat="server" |
| ImageUrl="~/images/buttonDelete.gif" T |
| oolTip="Delete This Item" /> |
| </td> |
| </tr> |
| </table> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| AllowMultiRowEdit="True" AutoGenerateDeleteColumn="True" |
| AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" GridLines="None" |
| Skin="Default2006" AutoGenerateColumns="False"> |
| <MasterTableView DataSourceID="SqlDataSource1"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="True"> |
| </ClientSettings> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid> |
| <div> |
| <asp:HyperLink ID="HyperLink1" runat="server" CssClass="lnkClose" |
| Text="Clear All" NavigateUrl="#" /> |
| </div> |
| <div class="padButtons"> |
| <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/buttonPPAddList.gif" /> |
| |
| <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/buttonPPAddCart.gif" /> |
| </div> |
| <asp:Panel ID="Panel1" runat="server"> |
| </asp:Panel> |
| </telerik:RadAjaxPanel> |
This is very unfortunate as CommandArgument is very convinient place for Eval("SomeDataField"). That way finding what was clicked would be very easy in ItemCommand and simmilar events (Delete, Insert...). Please consider this as nice feature for future implementations.
Regards,
Alex
PS
Finding what recordID is associated with ItemCommand is very dificult. This is what I do. Please correct if wrong:
| Select Case e.CommandName |
| Case "CheckDeleted" |
| Dim objItem As Telerik.Web.UI.GridDataItem = e.Item |
| Dim intRankID As Integer = _ |
| CInt(Regex.Match(Mid(objItem.KeyValues, _ |
| objItem.KeyValues.LastIndexOf(":") + 3), "[0-9]{1,}").Value) |
| 'The rest of the code goes here, now when I know |
| 'what KeyValue was clicked on and caused postback (ItemCommand) |
| Case "InitInsert" |
| '.... |
| End Select |

| <div style="width:200px"><img alt="product logo" src="../../Img/productLogoLight.gif" /></div> |