Having a curious problem with the PanelBar that I've never had before. The only difference this time is that I'm trying to use it in a Sharepoint environment. I should point out here that I've also got a Telerik radMenu control on the same page and that works fine.
The code for the menu is as follows:
ASCX:
<
telerik:RadPanelBar ID="radMenu" Runat="server">
</
telerik:RadPanelBar>
ASCX.VB
Imports
System
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.IO
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.WebControls
Imports Microsoft.SharePoint.WebPartPages
Imports Microsoft.SharePoint.Publishing.Navigation
Imports PublishingWeb = Microsoft.SharePoint.Publishing.PublishingWeb
Imports
PublishingWebCollection = Microsoft.SharePoint.Publishing.PublishingWebCollection
Imports
SPWebTemplate = Microsoft.SharePoint.SPWebTemplate
Imports Microsoft.SharePoint.Publishing
Imports Telerik.Web.UI
Partial
Public Class MOSS_InternetSideMenu
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim rootWeb As PublishingWeb = PublishingWeb.GetPublishingWeb(SPContext.Current.Site.RootWeb)
Dim defaultPageUrl As String = rootWeb.DefaultPage.ServerRelativeUrl
Dim smnHome As PortalListItemSiteMapNode = DirectCast(PortalSiteMapProvider.CombinedNavSiteMapProvider.FindSiteMapNode(defaultPageUrl), PortalListItemSiteMapNode)
For Each smnTopLevelItem As SiteMapNode In smnHome.ParentNode.ChildNodes
Dim rpi As New RadPanelItem
CreateParentMenuItem(rpi, smnTopLevelItem.Title.ToString, "", smnTopLevelItem.Url.ToString)
radMenu.Items.Add(rpi)
If smnTopLevelItem.HasChildNodes Then
For Each smnChildItem As SiteMapNode In smnTopLevelItem.ChildNodes
Dim rpiChild As New RadPanelItem
CreateSubMenuItem(rpiChild, smnChildItem.Title.ToString, "", rpi, smnChildItem.Url.ToString)
Next
End If
Next
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub
Sub CreateParentMenuItem(ByVal rpi As RadPanelItem, ByVal strItemText As String, ByVal strCssClass As String, ByVal strURL As String)
'adds main menu item
rpi.Items.Clear()
rpi.Text = strItemText
rpi.CssClass = strCssClass
rpi.PostBack =
False
End Sub
Sub CreateSubMenuItem(ByVal rpi As RadPanelItem, ByVal strItemText As String, ByVal strCssClass As String, ByVal rpiParent As RadPanelItem, ByVal strURL As String)
'adds sub menu item
rpi.Items.Clear()
rpi.Text = strItemText
rpi.CssClass = strCssClass
rpi.NavigateUrl = strURL
rpiParent.Items.Add(rpi)
End Sub
The menu displays fine, it just doesn't open. To make sure it wasn't a a coding error, I tried it with a static menu that I know works and got the same result.
Any help would be much appreciated.