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

Open in new window

5 Answers 112 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 18 Jun 2009, 10:01 PM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Jun 2009, 06:11 AM
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.
0
Paul
Telerik team
answered on 19 Jun 2009, 07:52 AM
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.
0
Dan
Top achievements
Rank 1
answered on 19 Jun 2009, 02:56 PM
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
0
Accepted
-DJ-
Top achievements
Rank 1
answered on 20 Jun 2009, 12:04 PM
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-
0
Dan
Top achievements
Rank 1
answered on 20 Jun 2009, 03:43 PM
Thanks DJ - that did the trick....

Dan
Tags
PanelBar
Asked by
Dan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Paul
Telerik team
Dan
Top achievements
Rank 1
-DJ-
Top achievements
Rank 1
Share this question
or