Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Splitter > How to access controls present in left radpane from inside a radwindow present in right radpane in spiltter ?

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

Feed from this thread
  • Bibhudutta avatar

    Posted on Feb 6, 2012 (permalink)

    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.

    Reply

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on Feb 9, 2012 (permalink)

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Splitter > How to access controls present in left radpane from inside a radwindow present in right radpane in spiltter ?
Related resources for "How to access controls present in left radpane from inside a radwindow present in right radpane in spiltter ?"

ASP.NET Splitter Features   |  Documentation   |  Demos  |  Telerik TV   |  Self-Paced Trainer   |  Step-by-step Tutorial  ]