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

RadGrid with OnItemCommand and ClientSettings-ClientEvents-OnCommand

1 Answer 167 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Somberg
Top achievements
Rank 2
Paul Somberg asked on 19 Apr 2013, 11:37 AM
Hello,

I have a RadGrid for which I use the OnItemCommand event. As expected, in the event handler I can find the GridDataItem from which the event was sent in the GridCommandEventArgs.Item.

Now I add a client side event handler for the event ClientSettings-ClientEvents-OnCommand. After this (javascript) event handler is called, a postback occurs and the server side OnItemCommand event is fired. But the GridCommandEventArgs.Item is now always referring to the first item in the grid and not the item that caused the event to be fired!

Am I doing something wrong?

Cheers,
Paul.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Apr 2013, 06:17 AM
Hello,

Yes, as this help topic says this could happen if you are firing a custom command on the client-side. All custom commands are fired through the first item in RadGrid. This behavior is by design.

Greetings,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Paul Somberg
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Share this question
or