I am creating several buttons in the the commandItemTemplate, I am using these to export tp csv plus many other things (I could use the commandItemSettings but dont want to). The problem I am having is that I cannot find the buttons in the code behind. My code is as follows.
Any help would be much appreciated.
<telerik:RadAjaxLoadingPanel runat="server" ID="progressLoader" MinDisplayTime="1500" InitialDelayTime="1000" Skin="Default"></telerik:RadAjaxLoadingPanel> |
<telerik:RadAjaxPanel runat="server" ID="rap_panel1" LoadingPanelID="progressLoader"> |
<telerik:RadGrid ID="RadGrid1" |
runat="server" |
GridLines="Vertical" |
ShowGroupPanel="True" |
PageSize="18" |
AllowSorting="true" |
AllowPaging="true" |
AutoGenerateColumns="false" |
EnableHeaderContextMenu="true" |
Skin="Default"> |
<ExportSettings> |
<Pdf FontType="Subset" PaperSize="A4" /> |
<Excel Format="Html" /> |
<Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" /> |
</ExportSettings> |
<MasterTableView DataKeyNames="ROWCLICK" GroupLoadMode="Client" CommandItemDisplay="Top"> |
<PagerStyle Mode="NextPrevNumericAndAdvanced" /> |
<CommandItemTemplate> |
<asp:LinkButton ID="btn_save" runat="server" CommandName="saveGrid" ><asp:Image runat="server" ID="img_save" ImageUrl="~/_resources/images/icons/tick.png"/></asp:LinkButton> |
<asp:LinkButton ID="btn_excel" runat="server" CommandName="excel" ><asp:Image runat="server" ID="Image1" ImageUrl="~/_resources/images/icons/xls_grey.gif"/></asp:LinkButton> |
<asp:LinkButton ID="btn_pdf" runat="server" CommandName="pdf" ><asp:Image runat="server" ID="Image2" ImageUrl="~/_resources/images/icons/pdf.gif"/></asp:LinkButton> |
</CommandItemTemplate> |
</MasterTableView> |
<ClientSettings ReorderColumnsOnClient="True" |
AllowDragToGroup="True" |
AllowColumnsReorder="True" |
EnablePostBackOnRowClick="true" |
AllowGroupExpandCollapse="true"> |
<Resizing AllowRowResize="True" |
AllowColumnResize="True" |
EnableRealTimeResize="True" |
ResizeGridOnColumnResize="False"> |
</Resizing> |
</ClientSettings> |
</telerik:RadGrid> |
</telerik:RadAjaxPanel> |
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated |
Dim item As GridCommandItem = TryCast(e.Item, GridCommandItem) |
If item IsNot Nothing Then |
Dim btn As Button = TryCast(item.FindControl("btn_excel"), Button) |
End If |
End Sub |
Any help would be much appreciated.