This is a migrated thread and some comments may be shown as answers.
Get Columns UniqueName from cell click (2)
3 Answers 49 Views
This is a migrated thread and some comments may be shown as answers.
peter
Top achievements
Rank 1
peter asked on 10 Mar 2010, 11:35 AM
Hi everyone,
In my previous post i asked how to get the uniquename of column if you click on a cell. The issue was succesfully answered; the code will retrieve the column name on the client side. But how to get the column name directly on the server-side?

Ciao Peter.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Mar 2010, 04:50 PM
Hello Peter,

It is not possible to achieve this server-side, but I can offer you a better approach. Please download the attached demo and let me know if you need further assistance.

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
peter
Top achievements
Rank 1
answered on 11 Mar 2010, 10:25 AM
Thanx a lot Daniel,
That works nicely!
0
Chris
Top achievements
Rank 1
answered on 05 Dec 2011, 09:14 PM
<script type="text/javascript">
       function rowClick(sender, args) {
           var cellindex = args.get_domEvent().target.cellIndex
           sender.get_masterTableView().fireCommand("CellClick", cellindex + "|" + args.get_domEvent().target.innerHTML);
       }
    </script>
Is it possible to change this to give me the column name instead of it's index?
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == "CellClick")
        {
            string[] args = e.CommandArgument.ToString().Split('|');
            int columnIndex = int.Parse(args[0]);
            string cellText = args[1];
            RadAjaxPanel1.Alert(String.Format("Column index: {0}\nCell text: {1}", columnIndex, cellText));
        }
    }

Tags
Grid
Asked by
peter
Top achievements
Rank 1
Answers by
Daniel
Telerik team
peter
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or