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

Radpanelbar Item link opening in new window

5 Answers 232 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
App Visible
Top achievements
Rank 1
App Visible asked on 03 Nov 2011, 12:24 PM
I am having an issue with RadPanelItem.When i click on any link the link is opening in new window instead of the target pane.The link should open the the targeted MainPane.Below is the code.Please help.Thanks in advance.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" %>


<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">


<head runat="server">
    <title></title>
    <telerik:RadCodeBlock runat="server" ID="radCodeBlock">
        <script type="text/javascript">
            function winMax() {
                var oWnd = $find("<%=RadWindow2.ClientID %>");
                oWnd.show();
                              
                oWnd.maximize();
                //alert("done"+win);
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body onload="winMax()">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sc01" runat="server"></asp:ScriptManager>
    <div">
        <telerik:RadWindowManager ID="RadWindowManager1"  runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWindow2" runat="server" Title="XBROKER" Behaviors="Minimize,Close" Skin="Default"  Width="100%"   MinimizeZoneID="toolbar">
                    <ContentTemplate>
                       <telerik:RadRibbonBar ID="RadRibbonBar1" runat="server">
                            <telerik:RibbonBarTab Text="Home">
                    
                            </telerik:RibbonBarTab>
                       </telerik:RadRibbonBar>
                       <telerik:RadSplitter ID="RadSplitter1" Width="99.9%" Height="82%" runat="server"
                        ResizeMode="EndPane">
                        <telerik:RadPane ID="RadPane1" runat="server" Width="18.8%" Scrolling="Y">
                        <telerik:RadPanelBar ID="RadPanelBarMenu" runat="server" ExpandMode="FullExpandedItem"
                        Height="100%" Skin="Default" Width="100%">
                        <Items>
                            <telerik:RadPanelItem ID="asd" runat="server" Expanded="true" Height="30px" Text="Business Setup">
                                <Items>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/Default.aspx"
                                        Target="MainPane" Text="Agent" >
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/BankSetup.aspx"
                                        Target="MainPane" Text="Bank">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/BankBranchSetup.aspx"
                                        Target="MainPane" Text="Bank Branch">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/BankAccountSetup.aspx"
                                        Target="MainPane" Text="Bank Accounts">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/BrokerHouseSetup.aspx"
                                        Target="MainPane" Text="Broker House">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/CompanySetup.aspx"
                                        Target="MainPane" Text="Company">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/CompanyBranchSetup.aspx"
                                        Target="MainPane" Text="Company Branch">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/InstrumentSectorSetup.aspx"
                                        Target="MainPane" Text="Instrument Sector">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/InstrumentIndustrySetup.aspx"
                                        Target="MainPane" Text="Instrument Industry">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/InstrumentMarginStatusDatewise.aspx"
                                        Target="MainPane" Text="Datewise Instrument Margin Status">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/InstrumentListingDatewise.aspx"
                                        Target="MainPane" Text="Datewise Instrument Listing">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem runat="server" NavigateUrl="~/BusinessSettingsSetup/NonTradingDaySetup.aspx"
                                        Target="MainPane" Text="Non Trading Day">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>


                        </Items>
                    </telerik:RadPanelBar>
                </telerik:RadPane>
                <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" />
                <telerik:RadPane runat="server" ID="MainPane" >


                </telerik:RadPane>
                 </telerik:RadSplitter> 
     
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager> 
    </div>
    </form>
</body>
</html>


5 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 04 Nov 2011, 01:23 PM
Hello App Visible,

The reason your link opens in a new window is because the MainPane is not an iframe, so it won't open the url inside of it. You'll need to embed an iframe in your MainPane and set that as the target.

I hope that helps.
0
Kate
Telerik team
answered on 07 Nov 2011, 04:33 PM
Hi John,

You could also refer to the following forum post where you can find an example how to achieve the desired behavior.

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
App Visible
Top achievements
Rank 1
answered on 16 Nov 2011, 08:44 AM
Thanks for the reply.The solution provided in the above link uses master page but i don't want to use any master page for this.Is there any possible ways to solve this without using master page.I have been using Telerik for a long time and the previous versions did not have any kind of issue like this.I'm seeing this issue in the new version only.Please help.Thanks.
0
Kate
Telerik team
answered on 16 Nov 2011, 04:40 PM
Hi John,

Using the OnClientItemClicking event of the RadPanelBar and the event handler below you can assign different content to the right side pane of the RadSplitter control.
<script type="text/javascript">
            function OnClientItemClicking(sender, args) {
                var item = args.get_item();
                if (item.get_text() == "Child RadPanelItem 3") {
                    $find("contentPane").set_contentUrl("http://www.stumbleupon.com/");                }
                else
                    alert(1);
            }
        </script>

I also attached my test page for reference.

Kind regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Dylan
Top achievements
Rank 2
answered on 07 Jun 2013, 09:20 AM
Hi Kate,

I'm facing same issue, but if I use OnClientItemClicking event it will cause the radpanelbar's parent bar not expanding after I click on the bar. The parent bar only will expand when I click on the radpanelbar arrow, not on the bar itself. How I can solve this?
Tags
PanelBar
Asked by
App Visible
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Kate
Telerik team
App Visible
Top achievements
Rank 1
Dylan
Top achievements
Rank 2
Share this question
or