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

[Solved] Get Column Clicked

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cole
Top achievements
Rank 1
Cole asked on 27 Mar 2012, 04:56 PM
Hi!  I was wondering if there is any way to determine which column was clicked through the OnRowSelect event.  I want to do one action for the last column, and a separate action for all the others.  Is this possible?

Cole

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 28 Mar 2012, 01:28 PM
Hello Cole,

You are not able to retrieve the clicked cell using the OnRowSelect event. What you can do instead is to hook another click handler to the tbody (using the OnLoad event) and check if the clicked item is in the last column.
Here is an example:
function onLoad(e) {
        $("#Persons tbody").on("click", "td", function (event) {
            var isLast = $(this).is(":last-child");
            if (isLast) {
                alert("You have clicked the last column!");
            }
        });
    }
I hope this helps.

Regards,
Petur Subev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Cole
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or