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

Pass the selected Row in Radgrid to textbox

3 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rehab
Top achievements
Rank 1
rehab asked on 11 Nov 2008, 07:53 PM
Dear Sir ,
plz i need help
I have two forms , form1   Called 
Assgine employe to postion.aspx   which contain radgrid and  searchemployee.aspx
1- Assgine employe to postion.aspx  contains button Called Search employee   which open Radwindow Manger  Contains  RadGrid Have all employeesNAME ,and Code
the problem that .
I want to select t employee from  radgrid in radwindow and assgin selected  value in row  to  textbox in otherfrom (assgin employee to postion )

thanks

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 14 Nov 2008, 09:50 AM
Hi rehab,

To see more information along the lines of the requested functionality, please refer to the following article. I hope this helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
rehab
Top achievements
Rank 1
answered on 14 Nov 2008, 07:27 PM
Dear sir ,

Thank you for these artical but  ineed to reterive the selected  row form radgrid in radwindow   and take these selected row and assgin it to  textbox in anothe radgrid .



i have  find these method  in telerik about selected row
  http://www.telerik.com/help/aspnet/grid/grdgettingcellvaluesforselectedrowsclientside.html

<script type="text/javascript">
var grid;

function RowSelected(rowObject)
{
  var selRow = this.GetCellByColumnUniqueName(rowObject,"ContactName");
  //here selRow.innerHTML will hold the value for the selected row contact name
}
function GetSelectedNames()
{
  for (var i = 0; i
< grid.MasterTableView.SelectedRows.length; i++)
  {
 var
curRow = grid.MasterTableView.GetCellByColumnUniqueName(grid.MasterTableView.SelectedRows[i], "ContactName");
 
//here curRow.innerHTML will hold the value for the selected rows contact names
  }
}
function GridCreated()
{
  
grid = this;
}


</script><rad:RadGrid id="RadGrid1" runat="server" AllowMultiRowSelection="True">
<ClientSettings>
   
<Selecting AllowRowSelect="True"></Selecting>
   
<ClientEvents OnGridCreated="GridCreated" OnRowSelected="RowSelected"></ClientEvents>
</ClientSettings>
</
rad:RadGrid>
<
INPUT onclick="GetSelectedNames();" type="button" value="Get selected rows contact names ">



But when i use it then it raise error  not accept  <ClientEvents OnGridCreated="GridCreated" OnRowSelected="RowSelected"></ClientEvents>  could u tell me why
</ClientSettings>

cuz  after i will take the selected item then i will  give these  item to textox in another radgrid could u tell me --- how ?

thanks

0
Yavor
Telerik team
answered on 18 Nov 2008, 07:42 AM
Hi rehab,

I reviewed the code and it looks correct. Can you please specify what is the error that you encountered? Also, what is the structure of the other grid? Are the textboxes that you are trying to populate located in an editForm, or perhaps in a template column?

Regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
rehab
Top achievements
Rank 1
Answers by
Yavor
Telerik team
rehab
Top achievements
Rank 1
Share this question
or