This is a migrated thread and some comments may be shown as answers.

Cannot fire off "OnCommand" event

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 07 Jun 2010, 05:09 PM
I am experimenting with the RadGrid, and want to display an alert when the OnCommand event fires, to see when OnCommand is triggered, but nothing is coming up.  

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="ds_MainGrid" GridLines="None"
Skin="WebBlue" Width="1025px" AutoGenerateColumns="False"  AllowAutomaticUpdates="True" ShowStatusBar="True" ShowFooter="True" >
<HeaderContextMenu EnableAutoScroll="True">
</HeaderContextMenu>
<MasterTableView DataSourceID="ds_MainGrid" DataKeyNames="ID" ClientDataKeyNames="ID" EditMode="InPlace" >
<Columns>
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
<ItemTemplate>
<asp:Button ID="btn_Row_Options" runat="server" Text="Options" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID">
<EditItemTemplate>
<asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' Width="27px" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' Width="27px"></asp:Label>
</ItemTemplate>
<HeaderStyle Width="20px" HorizontalAlign="Center" />
<ItemStyle Width="20px" />
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowColumnsReorder="True"  >
<ClientEvents OnCommand="grid_Command" /> 
</ClientSettings>
</telerik:RadGrid>

   
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function grid_Command(sender, eventArgs)
{
   alert('testing');
}
</script>
</telerik:RadCodeBlock>



1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 10 Jun 2010, 09:46 AM
Hello Richard,

I review the provided code however was not able to replicate the described issue locally. Please find attached s small runnable application which works as expected. Test it on your side and let me know what the difference in OnCommand initiating is in your case.


Greetings,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Richard M
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or