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

Value of selected Cell.

2 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 05 Sep 2013, 12:24 PM
Hi, 
 How do I get the value of the selected cell in radgrid?
 I don't want the whole row,but only the corresponding column value.

 Thanks,
 Erin.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 05 Sep 2013, 12:29 PM
Hi Erin,

Please try the following code snippet to get the cell value of the selected column cell.

ASPX:
<ClientSettings Selecting-CellSelectionMode="MultiCell">
    <ClientEvents OnCellSelected="OnCellSelected" />
</ClientSettings>

JS:
<script type="text/javascript">
    function OnCellSelected(sender, eventArgs) {
        var Rows = eventArgs.get_gridDataItem();
        var columnName = eventArgs.get_column().get_uniqueName();
        var data = Rows.get_cell(columnName);
        alert(data.innerHTML); //Get the cell value of the selected column   
    }
</script>

Thanks,
Princy
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Sep 2013, 12:34 PM
Sorry by mistake.
Tags
Grid
Asked by
Erin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or