New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("SiteMap", typeof(RadSiteMap))]
[EmbeddedSkin("SiteMap", "Default", typeof(RadSiteMap))]
[ClientScriptResource("Telerik.Web.UI.RadSiteMap", "Telerik.Web.UI.SiteMap.RadSiteMap.js")]
[TelerikToolboxCategory("Navigation")]
[ToolboxBitmap(typeof(RadSiteMap), "Toolbox.Icons.SiteMap.png")]
public class RadSiteMap : HierarchicalControlItemContainer, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, INamingContainer, IXmlSerializable, IControlItemContainer, IRadSiteMapNodeContainer

Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlControlItemContainerHierarchicalControlItemContainerRadSiteMap...

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlItemContainerIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorIFeatureGroupINamingContainerIParserAccessorIPostBackDataHandlerIRadSiteMapNodeContainerIScriptControlISkinnableControlIUrlResolutionServiceIXmlSerializable...

Inherited Members HierarchicalControlItemContainer.LoadViewState(object)HierarchicalControlItemContainer.SaveViewState()HierarchicalControlItemContainer.TrackViewState()HierarchicalControlItemContainer.GetDataSource()HierarchicalControlItemContainer.PerformDataBinding(IEnumerable)HierarchicalControlItemContainer.FindChildByUrl<TControlItem>(string)HierarchicalControlItemContainer.FindItemByHierarchicalIndex(string)HierarchicalControlItemContainer.LoadContentFile(string)HierarchicalControlItemContainer.MaxDataBindDepthHierarchicalControlItemContainer.DataNavigateUrlFieldHierarchicalControlItemContainer.DataFieldIDHierarchicalControlItemContainer.DataFieldParentIDControlItemContainer.PrepareForDataBinding()ControlItemContainer.GetXml()ControlItemContainer.LoadXml(string)ControlItemContainer.CreateItem(ClientStateLogEntry)ControlItemContainer.FindChild<TControlItem>(Predicate<TControlItem>)ControlItemContainer.GetAllChildren<TControlItem>()ControlItemContainer.FindChildByValue<TControlItem>(string)ControlItemContainer.FindChildByValue<TControlItem>(string, bool)ControlItemContainer.FindChildByText<TControlItem>(string)ControlItemContainer.FindChildByText<TControlItem>(string, bool)ControlItemContainer.FindChildByAttribute<TControlItem>(string, string)ControlItemContainer.ReadXml(XmlReader)ControlItemContainer.GetItemTypeFromXmlTagName(string)ControlItemContainer.ReadXmlForChildren(XmlReader)ControlItemContainer.WriteXml(XmlWriter)ControlItemContainer.WriteXmlForChildren(XmlWriter)ControlItemContainer.GetXml(XmlSerializer, TextWriter)ControlItemContainer.LoadXml(ControlItemContainer)ControlItemContainer.GetPostbackEventReference()ControlItemContainer.AppendDataBoundItemsControlItemContainer.DataTextFieldControlItemContainer.DataValueFieldControlItemContainer.DataTextFormatStringControlItemContainer.ValidationGroupControlItemContainer.PostBackUrlControlItemContainer.CausesValidationControlItemContainer.KeyboardNavigationSettingsControlItemContainer.TemplateControlItemContainer.ChildrenControlItemContainer.TagKeyDataBoundControl.OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)DataBoundControl.CreateDataSourceSelectArguments()DataBoundControl.GetData()DataBoundControl.MarkAsDataBound()DataBoundControl.OnDataPropertyChanged()DataBoundControl.OnDataSourceViewChanged(object, EventArgs)DataBoundControl.OnLoad(EventArgs)DataBoundControl.OnPagePreLoad(object, EventArgs)DataBoundControl.PerformSelect()DataBoundControl.ValidateDataSource(object)DataBoundControl.DataMemberDataBoundControl.IsUsingModelBindersDataBoundControl.ItemTypeDataBoundControl.SelectMethodDataBoundControl.DataSourceIDDataBoundControl.DataSourceObjectDataBoundControl.SelectArgumentsDataBoundControl.CreatingModelDataSourceDataBoundControl.CallingDataMethodsBaseDataBoundControl.ConfirmInitState()BaseDataBoundControl.DataBind()BaseDataBoundControl.EnsureDataBound()BaseDataBoundControl.OnDataBound(EventArgs)BaseDataBoundControl.OnInit(EventArgs)BaseDataBoundControl.OnPreRender(EventArgs)BaseDataBoundControl.DataSourceBaseDataBoundControl.InitializedBaseDataBoundControl.IsBoundUsingDataSourceIDBaseDataBoundControl.IsDataBindingAutomaticBaseDataBoundControl.SupportsDisabledAttributeBaseDataBoundControl.RequiresDataBindingBaseDataBoundControl.DataBoundWebControl.AddAttributesToRender(HtmlTextWriter)WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SkinIDWebControl.TabIndexWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.CreateChildControls()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadSiteMap()

Properties

The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()

C#
protected override string CssClassFormatString { get; }

Overrides: RadDataBoundControl.CssClassFormatString

Example:
C#
protected override string CssClassFormatString
{
       get
       {
           return "RadDock RadDock_{0} rdWTitle rdWFooter";
       }
}

Gets a collection of RadSiteMapNodeBindingCollection objects that define the relationship between a data item and the tree node it is binding to.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
public RadSiteMapNodeBindingCollection DataBindings { get; }
Property Value:

A RadSiteMapNodeBindingCollection that represents the relationship between a data item and the tree node it is binding to.

Gets or sets the SiteMapLevelSetting object to be used when no specific settings have been defined for a given level.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public DefaultSiteMapLevelSetting DefaultLevelSettings { get; }
Property Value:

A SiteMapLevelSetting object.

Individual levels can be customized using the LevelSettings collection. Levels not specified in this collection will get the default settings.

Gets or sets a value indicating whether the html encoding will be applied when the site map items are rendered.

C#
public bool EnableTextHTMLEncoding { get; set; }

By default RadSiteMap will not apply a html encoding when the site map items are rendered.

Gets the collection of LevelSettings objects that define the appearance of the nodes according to their level in the hierarchy.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public SiteMapLevelSettingCollection LevelSettings { get; }
Property Value:

A SiteMapLevelSettingCollection containing LevelSettings that define the appearance of the nodes according to their level in the hierarchy.

Gets a RadSiteMapNodeCollection object that contains the root nodes of the current RadSiteMap control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadSiteMapNodeCollection Nodes { get; }
Property Value:

A RadSiteMapNodeCollection that contains the root nodes of the current RadSiteMap control. By default the collection is empty (RadSiteMap has no children).

Implements: IRadSiteMapNodeContainer.Nodes

Use the nodes property to access the root nodes of the RadSiteMap control. You can also use the nodes property to manage the root nodes - you can add, remove or modify nodes.

Example:
cs-api-definition
RadSiteMap1.Nodes[0].Text = "Example";
RadSiteMap1.Nodes[0].NavigateUrl = "http://www.example.com";

Gets a collection of RadSiteMapNode objects that represent the node in the control that is currently selected.

C#
[Browsable(false)]
public RadSiteMapNode SelectedNode { get; }

Gets or sets a value indicating whether to render node lines in a fashion similar to RadTreeView.

C#
public bool ShowNodeLines { get; set; }
Property Value:

true if node lines should be rendered; false otherwise. The default value is false

Node lines are supported in List rendering mode without columns.

Methods

This methods clears the selected nodes of the current RadSiteMap instance.

C#
public void ClearSelectedNode()
C#
protected override ControlItemCollection CreateChildItemCollection()
Returns:

ControlItemCollection

Overrides: ControlItemContainer.CreateChildItemCollection()

C#
protected override NavigationItemBindingCollection CreateDataBindings()
Returns:

NavigationItemBindingCollection

Overrides: HierarchicalControlItemContainer.CreateDataBindings()

C#
protected override ControlItem CreateItem()
Returns:

ControlItem

Overrides: ControlItemContainer.CreateItem()

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: ControlItemContainer.DescribeComponent(IScriptDescriptor)

Gets a linear list of all nodes in the RadSiteMap control.

C#
public IList<RadSiteMapNode> GetAllNodes()
Returns:

IList<RadSiteMapNode>

An IList<T> containing all nodes (from all hierarchy levels).

C#
protected override IEnumerable<ScriptReference> GetScriptReferences()
Returns:

IEnumerable<ScriptReference>

Overrides: RadDataBoundControl.GetScriptReferences()

C#
protected override void InitializeItem(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.InitializeItem(ControlItem)

C#
protected virtual void OnTemplateNeeded(RadSiteMapNodeEventArgs e)
Parameters:eRadSiteMapNodeEventArgs
C#
protected override void RaiseItemCreated(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseItemCreated(ControlItem)

C#
protected override void RaiseItemDataBound(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseItemDataBound(ControlItem)

C#
protected override void RaiseTemplateNeeded(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseTemplateNeeded(ControlItem)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadDataBoundControl.RenderContents(HtmlTextWriter)

Events

Occurs when node is created.

C#
public event RadSiteMapNodeEventHandler NodeCreated

The NodeCreated event occurs before NodeDataBound and after postback if ViewState is enabled. NodeCreated is not raised for items defined inline in the ASPX.

Occurs when node is data bound.

C#
public event RadSiteMapNodeEventHandler NodeDataBound

Use the NodeDataBound event to set additional properties of the databound nodes.

Example:
cs-api-definition
protected void RadSiteMap1_NodeDataBound(object sender, RadSiteMapNodeEventArgs e)
{
e.Node.ToolTip = (string)DataBinder.Eval(e.Node.DataItem, "ToolTipColumn");
}

Occurs before template is being applied to the node.

C#
public event RadSiteMapNodeEventHandler TemplateNeeded

The TemplateNeeded event is raised before a template is been applied on the node, both during round-trips (postbacks) and at the time data is bound to the control. The TemplateNeeded event is not raised for nodes which are defined inline in the page or user control.

The TemplateNeeded event is commonly used for dynamic templating.

Example:
cs-api-definition
protected void RadSiteMap1_TemplateNeeded(object sender, Telerik.Web.UI.RadSiteMapNodeEventArgs e)
{
string value = e.Node.Value;
if (value != null)
{
// if the value is an even number
if ((Int32.Parse(value) % 2) == 0)
{
var textBoxTemplate = new TextBoxTemplate();
textBoxTemplate.InstantiateIn(e.Node);
}
}
}