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

[Solved] Retrieve Column Index of Selected Cell On the Client-Side

1 Answer 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
r00tsecurity
Top achievements
Rank 1
r00tsecurity asked on 10 Apr 2009, 11:07 AM
Hi

Is there a method to get the column index of clicked cell..
I have a client-side function

function OnRowSelected(sender, eventArgs)
{
   var 
value = eventArgs.getDataKeyValue("VEHICLE_ID");
   var colIndex = ??????;


so what is the appropriate method to get column index of clicked cell?


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Apr 2009, 01:28 PM
Hello,

Try the following approach:
<script type="text/javascript" language="javascript"
    function rowSelected(sender, eventArgs) 
    { 
        ... 
        if (eventArgs.get_domEvent().target.tagName == "TD"
            alert(eventArgs.get_domEvent().target.cellIndex); 
    }  
</script> 

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
r00tsecurity
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or