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

MDI - get reference to control in window

2 Answers 42 Views
Window
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 15 Feb 2012, 02:36 PM
Hi,
I'm using your demo about MDI - http://demos.telerik.com/aspnet-ajax/window/examples/radwindowandmdi/defaultcs.aspx 

I open 2 windows (for view data (radgrid) and for edit)

I want to get a reference to RadGrid in the 1. window when I click on tab to open 2. window but I don't know how.
Next I want to get selected row from RadGrid, get some values from there and pass to the second window with url - there is no problem.
With one window there is no problem:

var grid = $find("<%= rgMain.ClientID %>");

I don't know how to do it in this online example
Thanks.

2 Answers, 1 is accepted

Sort by
0
wnl
Top achievements
Rank 1
answered on 16 Feb 2012, 10:33 AM
Any ideas?
0
Marin Bratanov
Telerik team
answered on 16 Feb 2012, 05:17 PM
Hello,

You can find an example how to call a function in a different RadWIndow in this help article: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html. You can declare a function in the page with the grid  that will reference the grid and generally perform the needed custom functionality you have in mind. This function can then simply return the result to the main page, from where you can pass it to the second RadWindow easily by using the approach illustrated in this article: http://www.telerik.com/help/aspnet-ajax/window-programming-using-radwindow-as-dialog.html. What is important in your case is to store references in global JS variables to these two RadWindows so you can actually get this working. This is easiest done when opening them - for example by checking for a certain URL, title or something else, depending on your custom logic.


Kind regards,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Window
Asked by
wnl
Top achievements
Rank 1
Answers by
wnl
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or