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

How to access controls present in left radpane from inside a radwindow present in right radpane in spiltter ?

3 Answers 201 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Bibhudutta
Top achievements
Rank 1
Bibhudutta asked on 06 Feb 2012, 02:32 PM
I have a rad splitter, inside that i have two RadPanes named as "rLeftPane" and "rContentPane".

In "rLeftPane" RadPane (ie. LEFT RadPane) I am loading an ASP.NET usercontrol which behaves as a menu, the usercontrol basically, is nothing but a RadWindow.

Now inside the "rContentPane" RadPane(ie. RIGHT RadPane) I am having another RadWindow named as "rwMain", which is used to load the aspx pages (combination of master page and content page), which is loaded in AJAX call and does not postback's the page.

Now what I want is, this, staying inside the "rContentPane" RadPane's (ie. RIGHT RadPane) RadWindow, at page loading, I want to access a control's present inside RadWindow which is in "rLeftPane" RadPane(ie. LEFT RadPane).

Here is the code :

<telerik:RadSplitter ID="Splitter" runat="server" Width="100%" Height="100%" VisibleDuringInit="false"
            Skin="Office2007" OnClientResizing="Resizing">

            <telerik:RadPane ID="rLeftPane" runat="server" Width="200" MinWidth="200" MaxWidth="200"
                OnClientCollapsed="WindowShow" OnClientExpanded="WindowShow" BackColor="DarkGray">

                <ERPx:LeftMainMenu ID="ucLeftMainMenu" runat="server" /> // This is my UserControl

            </telerik:RadPane>

            <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" EnableResize="false" />

            <telerik:RadPane ID="rContentPane" runat="server">

                <telerik:RadWindow ID="rwMain" runat="server" VisibleOnPageLoad="true" ShowContentDuringLoad="false"
                    OnClientShow="WindowShow" VisibleStatusbar="False" Behaviors="None" EnableShadow="false" OnClientBeforeClose="OnClientBeforeClose1" OnClientPageLoad="WindowLoad" IconUrl="images/18_users.gif" Skin="Office2007">
                </telerik:RadWindow>

            </telerik:RadPane>
        </telerik:RadSplitter>

Please help me out.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Feb 2012, 09:45 AM
Hi Bibhudutta,

You can use the OnClientPageLoad event of the rwMain to capture the page loaded event of the page loaded inside it. Note that this is the client-side event that is fired once the page is completely loaded on the client. Then you need to get a reference to the controls inside the left RadWindow that you wish to modify. In case they are in its ContentTemplate they are available on this page and this becomes a matter of obtaining the reference, which can be done from the user control - you can store global JavaScript variables that reference the desired controls. Note, that generally this scenario defeats the purpose of user conrtols - all this JavaScript that is needed will make them difficult to reuse and multiple instances on the same page will not function properly. In case you load yet another page in the left RadWindow you need to call a function from that page that will do the job, as you cannot otherwise access iframes. How to do this is explained here. Now, in case you are referring to the server-side Page_Load event of the page loaded in the right-hand side RadWindow - this is not possible. You cannot access different pages in the code-behind. You could create a global class to store needed data and then initiate an AJAX request to reload your UC and load the data from this class for example, yet cross-page communication is a general task that is not related to the RadControls. You could also inject a script that will invoke a function from this page, obtain needed data, call a function on the parent page (where the splitter is) that will, again, access the left pane as described above.


Greetings,
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 >>
0
devanshi
Top achievements
Rank 1
answered on 14 May 2014, 11:12 AM
i have same issue.

I have a rad splitter, inside that i have three RadPanes  in main page.
also i added user control for schedular named UserSchedulerReminder inside main page.
in middle radpane i include radwindow manager for opening different windows.

i want find the user control inside main page from radwindow  on click  of button inside radwindow.

what should i do.

here is my design code of main page.

    <uc:Header ID="Header" runat="server" />
   
      <telerik:RadWindowManager ID="radwindowManagerHome" RestrictionZoneID="RestrictionZone"
        runat="server" EnableEmbeddedSkins="false" ShowContentDuringLoad="false" EnableEmbeddedBaseStylesheet="true" Skin="BasicBlue"
        VisibleStatusbar="false" InitialBehaviors="Maximize" VisibleOnPageLoad="false" DestroyOnClose="true"
        OnClientPageLoad="OnClientPageLoad" OnClientActivate="OnClientActivate" OnClientClose="OnClientClose"
        OnClientCommand="OnClientCommand" CssClass="radwindowHome" OnClientBeforeClose="OnClientBeforeClose"
        Width="100%" Height="100%" AutoSize="true" AutoSizeBehaviors="Height">
    </telerik:RadWindowManager>
    <div style="float: none !important; margin: 0 auto; width: 98%">
       <telerik:RadSplitter ID="MainSplitter" runat="server" Width="100%" Height="750" Orientation="Vertical">
            <telerik:RadPane ID="radLeftPane" runat="server" Height="200px" Width="10%" MinWidth="20" MaxWidth="200">
                <div class="onlineuserslistarea">
                    <table width="98%" border="0" cellspacing="0" cellpadding="0" class="dash_wid_table">
                        <tr>
                            <td width="12" height="32" align="left" valign="top" class="top_left">
                                &nbsp;
                            </td>
                            <td align="left" valign="middle" class="top_center">
                                Online Users
                            </td>
                            <td width="12" align="left" valign="top" class="top_right">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="border: solid 1px  #4E647D; max-height: 200px;">
                                <div class="nouseronlinemessage" id="onlineuserslistarea" runat="server" Width="100%" Height="710">
                                 Online User List
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="radsplitbarLeft" runat="server" CollapseMode="Forward" CssClass="splitterbarleft"
                Style="z-index: 111111 !important;" />
            <telerik:RadPane ID="radMiddlePane" runat="server" Width="75%" MinWidth="500" OnClientResized="OnClientResized">
                <div id="RestrictionZone" class="restrictionZone">
                    <!-- / -->
                </div>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="radsplitbarRight" runat="server" CollapseMode="Backward" />
            <telerik:RadPane ID="radRightPane" runat="server" Height="200px" Width="15%" MinWidth="50">
                <div class="openwindowlistarea">
                    <table width="98%" border="0" cellspacing="0" cellpadding="0" class="dash_wid_table"
                        style="margin-left: 1%;">
                        <tr>
                            <td width="12" height="32" align="left" valign="top" class="top_left">
                                &nbsp;
                            </td>
                            <td align="left" valign="middle" class="top_center">
                                Open Windows
                            </td>
                            <td width="12" align="left" valign="top" class="top_right">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="border: solid 1px  #4E647D;">
                                <telerik:RadTabStrip OnClientTabSelected="OnClientTabSelected" ID="radTabStripHome"
                                    ScrollChildren="true" ScrollButtonsPosition="Middle" Width="100%" Height="710"
                                    CssClass="taskbar" Orientation="VerticalRight" runat="server" Skin="WebBlue"
                                    Align="left">
                                    <Tabs>
                                       <telerik:RadTab Text="Dashboard"  Style="text-align: left;">
                                       </telerik:RadTab>
                                    </Tabs>
                                </telerik:RadTabStrip>
                               
                            </td>
                        </tr>
                    </table>
                </div>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    <div class="clear">
    </div>
    <uc:Footer ID="Footer" runat="server" />
         <uc:UserSchedulerReminder ID="UserSchedulerReminder" runat="server" />

    <telerik:RadCodeBlock ID="radCodeBlockHome" runat="server">
        <script type="text/javascript">
       
            var manager = null;
            var tabStrip = null;
            var currentWnd = null;
            var confirmpromptwindow = null;
            var pageurl = null;
            var buttonok = null;
           
            Sys.Application.add_load(function () {
               
                //get a reference to the needed controls -
                manager = $find("<%=radwindowManagerHome.ClientID %>");

                tabStrip = $find("<%=radTabStripHome.ClientID %>");
                confirmpromptwindow = $find("<%=rwConfirmPrompt.ClientID %>");
                buttonok = $find("<%= btnok.ClientID %>");
                pageurl = $("#<%= hdnpageurl.ClientID %>");
                ShowOpenWindows();

            });
         
                      
              </script>
    </telerik:RadCodeBlock>
0
Vessy
Telerik team
answered on 19 May 2014, 07:28 AM
Hello Devanshi,

Detailed explanation on how to access the parent page of a RadWindow from inside the window (and vice versa) is available in the following help article: Calling Functions in Windows.

Please, give the suggestions in it a try and let me know how it goes.

Kind regards,
Vessy
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Splitter
Asked by
Bibhudutta
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
devanshi
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or