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

[Solved] Get the data from the selected Row in Radgrid

3 Answers 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Agm
Top achievements
Rank 1
Agm asked on 10 May 2013, 12:32 AM
Hi,
I am having a Radgrid and a Textbox in a page.

On the Row selection,I have to fill the Textbox with the data from Radgrid column1 "Name".

when clicking on the row in grid,we have to fill the textbox which is outside the grid.

please help me to solve this.

Thanking you,

Regards,
AGMRAJA

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 May 2013, 03:41 AM
Hi,

Please try the following code snippet to fill the TextBox in the selected row.

ASPX:
<ClientEvents OnRowSelected="OnRowSelected" />

Javascript:
<script type="text/javascript">
    function OnRowSelected(sender, args)
    {
        var grid = sender;
        var MasterTable = grid.get_masterTableView();
        var rows = MasterTable.get_dataItems()[args.get_itemIndexHierarchical()]
        rows.findElement("TextBox1").value = "your text";
    }
</script>

Thanks,
Princy.
0
Agm
Top achievements
Rank 1
answered on 10 May 2013, 03:03 PM
Hi Princy,
thanks for the reply.
But this is not what i am expecting.
Im having the grid,but the textbox is not inside the grid.
I mean not in the row of grid.
On Row selection,I have to fill the textbox which is outside the grid.
please help me to resolve this.

Thanking you,

Regards,
AGMRAJA
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 May 2013, 04:34 AM
Hi Agm,

Please take a look into the following code snippet to fill the TextBox with a value on Row selection.

Javascript:
<script type="text/javascript">
    function OnRowSelected(sender, args) {
        var text = document.getElementById("TextBox1");
        text.value = "your text";
    }
</script>

Please provide your code if it doesn't help.

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