Hi,
I have a grid with a CommandItemTemplate. When I press the LinkButton "btCommand" I want first to treat the event on client side.
The behavior I'm getting is when I press the LinkButton the page immediatly does the PostBack without calling first the "gridCommand" function, thus I never get the alert('test') calle.
Thanks in advance.
I have a grid with a CommandItemTemplate. When I press the LinkButton "btCommand" I want first to treat the event on client side.
The behavior I'm getting is when I press the LinkButton the page immediatly does the PostBack without calling first the "gridCommand" function, thus I never get the alert('test') calle.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function gridCommand(sender, args) { alert('test'); if (args.get_commandName().startsWith("DoSomething")) { .... } } </script></telerik:RadScriptBlock> <telerik:RadGrid ID="gv" runat="server" AllowFilteringByColumn="false" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false" EnableAJAX="false" EnableEmbeddedSkins="false" GridLines="Horizontal" OnItemCommand="gv_ItemCommand" OnItemCreated="gv_ItemCreated" PageSize="30" Width="100%" OnExcelMLExportRowCreated="gv_ExcelMLExportRowCreated" OnExcelMLExportStylesCreated="gv_ExcelMLExportStylesCreated"> <ExportSettings IgnorePaging="false"></ExportSettings> <MasterTableView AllowMultiColumnSorting="false" CommandItemDisplay="Top" DataKeyNames="ID" GridLines="None" > <Columns> <telerik:GridBoundColumn AllowFiltering="false" AllowSorting="True" DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID"> </telerik:GridBoundColumn> ..... </Columns> <CommandItemTemplate> <table class="Normal" cellspacing="0" cellpadding="4" border="0" width="100%"> <tr> <td align="right"> <asp:LinkButton ID="btCommand" runat="server" CommandName="DoSomething" >DoSomething</asp:LinkButton> </td> </tr> </table> </CommandItemTemplate> <CommandItemStyle HorizontalAlign="Right" /> </MasterTableView> <ClientSettings> <ClientEvents OnCommand="gridCommand" /> </ClientSettings> </telerik:RadGrid>Thanks in advance.
