| RadComboBoxItem editItem = new RadComboBoxItem("Select a Country...", "" ) {Visible = false, Enabled = false}; |
cmbCats.SelectedIndex = cmbCats.FindItemIndexByValue(
value.NewsCategoryID.ToString());
cmbCats.Text = cmbCats.SelectedItem.Text;
We're using a List as the datasource object and if the above code is omitted the error is avoided, but obviously the correct item isn't selected.
I hope this is enough information to help you diagnose the problem.
Thanks,
Gavin.
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;return oWindow;
}
function CloseAndReload()
{
var oWnd = GetRadWindow().BrowserWindow;
oWnd.location.href = oWnd.location.href;
}
function ExpandCollapseAllInZone(zoneId, expanded)
{
var zone = $find("<%= radDockingZone.ClientID %>");
if (zone) {
var docks = zone.get_docks();
for (var i in docks) {
if (expanded == 'true') {
//attempt to expand all the docks
//#####################the following statement does not work##################
docks[i].set_collapsed(
'false');
}
else {
//attempt to collapse all the docks
//#####################this statement works##################
docks[i].set_collapsed(
'true');
}
docks[dock].updateClientState();
}
}
}
<%
@ Control Language="vb" AutoEventWireup="false" CodeBehind="MOSS_InternetTopMenu.ascx.vb" Inherits="MOSS_InternetSideMenu.MOSS_InternetTopMenu" %>
<%
@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<
telerik:RadMenu ID="topMenu" Runat="server">
</
telerik:RadMenu>
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_InternetTopMenu
Inherits System.Web.UI.UserControl
Private currentSite As SPSite
Private currentWebRoot As SPWeb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
currentSite = SPContext.Current.Site
currentWebRoot = SPContext.Current.Site.RootWeb
If HttpContext.Current.User.Identity.IsAuthenticated = False Then
SPSecurity.RunWithElevatedPrivileges(
AddressOf Me.PopulateMenu)
End If
End If
End Sub
Private Sub PopulateMenu()
Try
Dim elevatedSiteColl As SPSite
Dim elevatedWebRoot As SPWeb
elevatedSiteColl =
New SPSite(currentSite.ID)
elevatedWebRoot = elevatedSiteColl.OpenWeb(currentWebRoot.ID)
Dim rootWeb = PublishingWeb.GetPublishingWeb(elevatedWebRoot)
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 NewMenuItem As New RadMenuItem
NewMenuItem.Text = smnTopLevelItem.Title
NewMenuItem.NavigateUrl = smnTopLevelItem.Url
topMenu.Items.Add(NewMenuItem)
If smnTopLevelItem.HasChildNodes Then
For Each smnChildItem As SiteMapNode In smnTopLevelItem.ChildNodes
Dim NewChildItem As New RadMenuItem
NewChildItem.Text = smnChildItem.Title
NewChildItem.NavigateUrl = smnChildItem.Url
NewMenuItem.Items.Add(NewChildItem)
Next
End If
Next
Catch ex As Exception
End Try
End Sub
End
Class
