Selected value from client side

2 posts, 1 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 09 May 2012 Link to this post

    How to pass the cell value that is selected in a grid to a textbox in templatcolumn?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 May 2012 Link to this post

    Hello Tina,

    Try the following javascript to acheive your scenario.
    JS:
    function OnRowSelected(sender, args)
    {
     var masterTable = sender.get_masterTableView();
     var selectedrow = masterTable.get_selectedItems();
     for (var i = 0; i < selectedrow.length; i++)
     {
       var cell = masterTable.getCellByColumnUniqueName(selectedrow[i], "UniqueName");
       var textbox = selectedrow[i].findElement('TextBox1');
       textbox.value = cell.innerHTML;
     }
    }

    Thanks,
    Shinu.
Back to Top