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

[Solved] ClientEvents: OnCommand Problem

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 29 May 2009, 02:28 PM
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:

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"
and everything after columns:
<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> 



1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 30 May 2009, 02:02 PM
Hi Michael,

This is an issue with RadGrid our development team is acquainted with and will give it due attention for the coming later versions of the controls.

Excuse us for any inconvenience this might have caused you.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or