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

[Solved] Cooy cell value

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anly
Top achievements
Rank 1
Anly asked on 17 May 2013, 06:24 AM
Hi,

I have a radgrid and on clicking a cell, i want to copy the cell text to a radtextbox on clicking the cell. Is it possible in JS?

Thanks,
Anly.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 May 2013, 06:43 AM
Hi,

Try the following code to access the clicked cell value from client side by attaching OnRowClick event to radgrid.
JS:
<script type="text/javascript">
 function OnRowClick(sender, args)
  {
        var textbox = document.getElementById("<%= TextBox1.ClientID %>");
        var targetCell = args.get_domEvent().target;
        var value = targetCell.innerHTML; // Clicked value
        textbox.value = value;
  }
</script>

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