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

get row clicked on from OnCommand client handler

2 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Simmonds
Top achievements
Rank 1
David Simmonds asked on 11 Aug 2010, 07:31 PM
I have a client side event handler for OnCommand. How can I get the index of the row that caused the OnCommand event to be fired. In my case I have a GridButtonColumn of type ImageButton. Clicking the image for an item in the row causes the OnCommand to fire. I need to know which row was clicked.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 12 Aug 2010, 06:23 AM
Hello David,

Try the following code in OnCommand client event handler to get the row index.

ASPX:
<ClientSettings >
   <ClientEvents OnCommand="OnCommand" />
</ClientSettings>

Java Script:
<script type="text/javascript">
    function OnCommand(sender, args) {
        var rowIndex = args.get_commandArgument(); // getting row index
       }
</script>

Thanks,
Princy.
0
Diana
Top achievements
Rank 1
answered on 21 Mar 2013, 02:29 PM
Princy, you are a gem. I've been looking for an answer to this for hours now! Thanks :)
Tags
Grid
Asked by
David Simmonds
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Diana
Top achievements
Rank 1
Share this question
or