This is a migrated thread and some comments may be shown as answers.

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

1 Answer 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 21 Nov 2013, 06:17 PM
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);
}

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Nov 2013, 04:12 AM
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
Tags
Grid
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or