Cellindex of Radnumerictextbox in a radgrid

4 posts, 0 answers
  1. Neha
    Neha avatar
    4 posts
    Member since:
    Mar 2011

    Posted 18 Mar 2011 Link to this post

    There is a context menu for the controls in a radgrid. Following is a part of client-side script for displaying the menu:
    function contextMenu(sender, args)
    {
            var evt = args.get_domEvent();
            var td = (evt.srcElement) ? args.srcElement : evt.target;
            var cols = args.get_tableView().get_columns();
            var col = cols[td.parentElement.cellIndex]; //-----> this is undefined
            var index = args.get_itemIndexHierarchical();
            document.getElementById("radGridClickedRowIndex").value = index;
            document.getElementById("radGridClickedColName").value = col.get_uniqueName();
            document.getElementById("radGridModifiedValue").value = td.value;
            //................
    }

    It is working fine for asp:textbox but not able to get 'CellIndex' for the Radnumerictextbox.
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 23 Mar 2011 Link to this post

    Hello Neha,

    I recommend that you use parentNode instead of parentElement otherwise you may have problems in non-IE browsers.

    I would also suggest that you examine the way we have implemented the context menu in our online demo:
    AJAX-enabled Context Menu

    Best regards,
    Daniel
    the Telerik team
  3. Neha
    Neha avatar
    4 posts
    Member since:
    Mar 2011

    Posted 24 Mar 2011 Link to this post

    Hi,
    Thanks for the suggestion :) we will surely look into that. Anyways.. we got the above issue solved by using: "td.parentElement.parentElement.cellIndex"
  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 24 Mar 2011 Link to this post

    Hello Neha,

    I'm glad that you have found a solution to this problem. Let me reiterate that parentElement does not work in all cases - in Mozilla Firefox for example.

    Best regards,
    Daniel
    the Telerik team
Back to Top