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

Getting Cell Values for Selected Rows Client-side

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 26 Oct 2011, 08:44 PM

Hello,

 

I'm trying to get Cell Values for Selected Rows Client-side, and I followed the following example below, but what about if the cell is a text box or drop down list?  I am getting null on innerhtml and value when I reference those controls within the grid.  Is there a different method to access controls within the grid and not necessarily the bound fields?

http://www.telerik.com/help/aspnet-ajax/grid-getting-cell-values-for-selected-rows-client-side.html

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Oct 2011, 04:31 AM
Hello Michael,

I suppose you want to access TextBox control in GridTemplateColumn. Here is the sample code.

Javascript:
<script type="text/javascript">
function OnRowSelecting(sender,args)
{
 var grid = sender;
 var masterTable = grid.get_masterTableView();
 var row = masterTable.get_dataItems();
 for (var i = 0; i < row.length; i++)
 {
  var txtbox = row[i].findElement('TextBox1');
   alert(txtbox.value);
 }
}
</script>

Thanks,
Shinu.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or