I have subscribed to the OnCommand event in my grid. I have a GridButtonColumn that I'm catching the command on, and setting a global JS variable. No cancelling... I just need to know it was clicked basically. Once I did this, I noticed that when I have more than one record, the server side ItemCommand event has the wrong RowIndex/DataKeyValues. If I do nothing but take the clientevents out, all is well, and the indexes and operations are fine. Here is the JS I have in my OnCommand:
If it's any consellation, here's the MasterTableView declaration:
and everything after columns:
| function estGridCommandClicked(sender, eventArgs) { |
| var command = eventArgs.get_commandName(); |
| if (command == "Update") |
| _containsDirtyEstimates = true; |
| } |
If it's any consellation, here's the MasterTableView declaration:
| <telerik:RadGrid ID="GridView1" runat="server" AutoGenerateColumns="false" |
| onitemcommand="GridView1_ItemCommand" AllowAutomaticUpdates="false" OnItemDataBound="GridView1_RowDataBound" |
| OnUpdateCommand="GridView1_UpdateCommand"> |
| <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ID" ClientDataKeyNames="ID"> |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <OKS_Controls:EstimateAdd runat="server" id="EstimateAdd1" ValidationGroup="EstValidationGroup" /> |
| </FormTemplate> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| <CommandItemSettings AddNewRecordText="Request a New Estimate" /> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents OnCommand="estGridCommandClicked" OnRowCreated="estGridRowCreated" /> |
| </ClientSettings> |