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

[Solved] selecting row from radGrid inside a radWindow and populating a second radGrid on parent page Razor

1 Answer 56 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mian
Top achievements
Rank 1
mian asked on 06 Sep 2011, 07:04 AM
Hi Telerik Team, Hi everyone ... 

m working with MVC3, inside a popup window i have populated a radGrid  with a select button column. fine so far ... now i want that when button in some row  is pressed the window closes and the selected row data populates a grid on parent page. i want client side functionality

moreover even if Select button column is replaced with a checkBox column , for multi selection ,.. and a submit button  to populate the radGrad on parent page with all the selected row's data....

i just want to mention that my popup window is populating with a Partial View , containing a radGrid...

I can explain further if any problem to understand ma scenario. 

Thanx everyone for help , plz help me ... 

1 Answer, 1 is accepted

Sort by
0
mian
Top achievements
Rank 1
answered on 07 Sep 2011, 06:23 AM
ok I have done it ... by adding a simple java script , on the partial view page which is populating my popup window

  //customerSelectPopup-grid' is my rad Grid on  popup window , containing "CustomerID" column and "CustomerName" column as its 2nd and 3rd column .. I want to get these values on parent page when i click on some row at radGrid. parent page is a strongly types view containing CustomerID and CustomerName in its Model. 

so the following Java Script works for me 


 //CustomerID


<script type="text/javascript">
  $(document).ready(function () {       

  $("[id$='customerSelectPopup-grid'] table tr td:nth-child(1) a").click(function () {   
$("#@Html.FieldIdFor(model => model.CustomerID)").val($(this).parent().next().text());       
  $("[id$='CustomerName']").val($(this).parent().next().next().text())
 
          $('#CustomerSelectWindow').close();     
          return false;
            })
        });
can someone has any other idea??? ... 
Thanx .. 

              
          
Tags
Window
Asked by
mian
Top achievements
Rank 1
Answers by
mian
Top achievements
Rank 1
Share this question
or