eventArgs.get_gridColumn().get_element().cellIndex;

1 Answer 99 Views
Grid
anna
Top achievements
Rank 1
Bronze
Iron
anna asked on 22 Jan 2022, 06:47 AM | edited on 23 Jan 2022, 12:13 PM

In Telerik:RadGrid , ASP.NET , Web,

 

<ClientSettings EnablePostBackOnRowClick="true">  
<Selecting ColumnClick="true" /> 
</ClientSettings>   
protected void RadGrid_ItemConmmand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "ColumnClick")
            {              
                var text = "";
                text += "Column was clicked";
                text += ", Index: " + eventArgs.get_gridColumn().get_element().cellIndex;
                alert(text);
            }

 

Is the grammar correct?

Please Help Me


1 Answer, 1 is accepted

Sort by
0
Doncho
Telerik team
answered on 26 Jan 2022, 01:14 PM

Hi Anna,

It seems that the code you have shared is mixing the client-side and server-side approaches for getting a reference to an element inside the Grid.

Please check out the documentation sections dedicated to accessing the elements of the RadGrid:

Please let us know what you would like to achieve so we can assist more accurately.

If the aim is to get the column holding a clicked Cell of the RadGrid, I would suggest you check out the following forum post - Find out the clicked column in a row.

Kind regards,
Doncho
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
anna
Top achievements
Rank 1
Bronze
Iron
Answers by
Doncho
Telerik team
Share this question
or