Open in new window

6 posts, 1 answers
  1. Dan
    Dan avatar
    7 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    Hi,

    Is there a way to set the PanelBar up with the DataNavigateUrlField so that clicking on the item will open the page in a new window?

    Thanks,
    Dan
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Jun 2009 Link to this post

    Hi dan,

    I tried following approach for opening the page in radwindow on clicking the RadPanelItem. I have attached the "OnClientItemClicking" event and explicitly opens the radWindow from clientside code. Give a try with this code.

    ASPX:
     
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnClientItemClicking="OnClientItemClicking" 
        DataSourceID="SqlDataSource1" DataNavigateUrlField="url" 
        DataTextField="Name" DataValueField="Name">  
    </telerik:RadPanelBar> 

    JavaScript:
     
    <script type="text/javascript">  
    function OnClientItemClicking(sender, args)  
    {  
        var panelItem = args.get_item();  
        if(panelItem.get_navigateUrl()!="#")  
        {  
            args.set_cancel(true);  
            var window1 = radopen(panelItem.get_navigateUrl(),"win1");  
        }      
    }  
    </script> 

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 19 Jun 2009 Link to this post

    Hi Dan,

    You can easily achieve your goal by setting the Target property for the RadPanelItem to "_blank".

    Regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Dan
    Dan avatar
    7 posts
    Member since:
    Jun 2009

    Posted 19 Jun 2009 Link to this post

    Thanks for the responses but I am binding the RadPanel to a DataTable and I don't explicitly define a RadPanelItem, so I'm not able to set the Target property of the PanelItem. It is very similiar to your online example of PanelBar / Hierarchical Data Binding.

    Any other ideas?

    Thanks,
    Dan
  6. Answer
    -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 20 Jun 2009 Link to this post

    Hi Dan,

    You can use the itemcreated event to set the target:

        Protected Sub RadPanelbar1_ItemCreated(ByVal s As ObjectByVal e As RadPanelBarEventArgs) Handles RadPanelBar1.ItemCreated 
            e.Item.Target = "_blank" 
        End Sub 


    Regards,
    -DJ-
  7. Dan
    Dan avatar
    7 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2009 Link to this post

    Thanks DJ - that did the trick....

    Dan
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017