How I can get by client side tha dat cell from a row

2 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    2 posts
    Member since:
    Oct 2013

    Posted 21 Nov 2013 Link to this post

    Hello friends of telerik. I want to pass tha data cells from a row to textboxs by client-side.
    I try to follow this tutorial but I only have the same result with the object undefinided. How i can do this? what is the real name of the column?
    Here is my code (Don't worry If you can't understand the name, it's on spanish) and a screen shoot of the table.
    <telerik:RadGrid ID="dgv_usuarios" runat="server">
        <ClientSettings>
            <Selecting AllowRowSelect="true" />
            <Animation AllowColumnReorderAnimation="true" />
            <ClientEvents OnRowClick="rowUsuario" />
        </ClientSettings>
    </telerik:RadGrid>

    function rowUsuario(sender, eventArgs) {
          var grid = sender;
          var MasterTable = grid.get_masterTableView(); var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
          var cell = MasterTable.getCellByColumnUniqueName(row, "Nombre");
          alert("Su dato es: " + cell.innerHtml);
    }

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Nov 2013 Link to this post

    Hi Sebastian ,

    I guess you want to access the selected cell values on RowClick. Please try the following code snippet.

    ASPX:
    <ClientSettings>
       <ClientEvents OnRowClick="OnRowClick" />
    </ClientSettings>

    JS:
    function OnRowClick(sender, args)
     {
        var value = args.get_domEvent().target.innerHTML;
        alert(value);
     }

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top