RadSiteMapNode
Represents a node in the RadSiteMap control.
The RadSiteMap control is made up of nodes. Nodes which are immediate children of the control are root nodes. Nodes which are children of other nodes are child nodes.
A node usually stores data in two properties, the Text property and the NavigateUrl property.
To create nodes, use one of the following methods:
- Data bind the RadSiteMap control to a data source, for example SiteMapDataSource.
- Use declarative syntax to define nodes inline in your page or user control.
- Use one of the constructors to dynamically create new instances of the RadSiteMap class. These nodes can then be added to the Nodes collection of another node or site map.
When the user clicks a node, the RadSiteMap control navigates to the linked Web page. By default, a linked page is displayed in the same window or frame. To display the linked content in a different window or frame, use the Target property.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadSiteMapNode : NavigationItem, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IMarkableStateManager, IStateManager, INamingContainer, IXmlSerializable, IControlItemContainer, IRadSiteMapNodeContainer
Inheritance: objectControlWebControlControlItemNavigationItemRadSiteMapNode...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadSiteMapNode class.
public RadSiteMapNode()
Use this constructor to create and initialize a new instance of the RadSiteMapNode class using default values.
Initializes a new instance of the RadSiteMapNode class with the specified text, value and URL.
public RadSiteMapNode(string text, string navigateUrl)
The text of the node. The Text property is set to the value of this parameter.
navigateUrlstringThe url which the node will navigate to. The NavigateUrl property is set to the value of this parameter.
Use this constructor to create and initialize a new instance of the RadSiteMapNode class using the specified text, value and URL.
Properties
Gets or sets the Cascading Style Sheet (CSS) class applied by default to the node.
[ClientPersistedProperty]
public override string CssClass { get; set; }
Overrides:
By default the visual appearance of hovered nodes is defined in the skin CSS file. You can use the CssClass property to specify unique appearance for the node.
Gets the data item that is bound to the node
[Browsable(false)]
public override object DataItem { get; set; }
An Object that represents the data item that is bound to the node. The default value is null (Nothing in Visual Basic), which indicates that the node is not bound to any data item. The return value will always be null unless accessed within a NodeDataBound event handler.
Overrides:
This property is applicable only during data binding. Use it along with the NodeDataBound event to perform additional mapping of fields from the data item to RadSiteMapNode properties.
Gets or sets the Cascading Style Sheet (CSS) class applied to the node when it is disabled.
[ClientPersistedProperty]
public string DisabledCssClass { get; set; }
By default the visual appearance of disabled nodes is defined in the skin CSS file. You can use the DisabledCssClass property to specify unique appearance for a node when it is disabled.
Gets or sets a value specifying the URL of the image rendered when the node is disabled.
[ClientPersistedProperty]
public string DisabledImageUrl { get; set; }
If the
DisabledImageUrlproperty is not set the ImageUrl property will be used when the node is disabled.
Gets or sets a value indicating whether the node is enabled.
[ClientPersistedProperty]
public override bool Enabled { get; set; }
true if the node is enabled; otherwise false. The default value is true.
Overrides:
Disabled nodes cannot be clicked, or expanded.
Gets or sets the Cascading Style Sheet (CSS) class applied to the node when the mouse hovers it.
[ClientPersistedProperty]
public string HoveredCssClass { get; set; }
By default the visual appearance of hovered nodes is defined in the skin CSS file. You can use the HoveredCssClass property to specify unique appearance for a node when it is hoevered.
Gets or sets a value specifying the URL of the image rendered when the node is hovered with the mouse.
[ClientPersistedProperty]
public override string HoveredImageUrl { get; set; }
Overrides:
If the
HoveredImageUrlproperty is not set the ImageUrl property will be used when the node is hovered.
Gets or sets the URL to an image which is displayed next to the text of a node.
[ClientPersistedProperty]
public override string ImageUrl { get; set; }
The URL to the image to display for the node. The default value is empty string which means by default no image is displayed.
Overrides:
Use the ImageUrl property to specify a custom image that will be displayed before the text of the current node.
Gets the level of the node.
[Browsable(false)]
public int Level { get; }
An integer representing the level of the node. Root nodes are level 0 (zero).
Gets or sets the URL to navigate to when the current node is clicked.
[ClientPersistedProperty]
public override string NavigateUrl { get; set; }
The URL to navigate to when the node is clicked. The default value is empty string which means that clicking the current node will not navigate.
Overrides:
Gets a RadSiteMapNodeCollection object that contains the child nodes of the current RadSiteMapNode.
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadSiteMapNodeCollection Nodes { get; }
A RadSiteMapNodeCollection that contains the child nodes of the current RadSiteMapNode. By default the collection is empty (the node has no children).
Implements:
Use the Nodes property to access the child nodes of the RadSiteMapNode. You can also use the Nodes property to manage the child nodes - you can add, remove or modify nodes.
Gets or sets the template for displaying the node.
[TemplateContainer(typeof(RadSiteMapNode))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public ITemplate NodeTemplate { get; set; }
An object implementing the ITemplate interface. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.
To specify common display for all nodes use the NodeTemplate property.
Gets the parent IRadSiteMapNodeContainer.
[Browsable(false)]
public IRadSiteMapNodeContainer Owner { get; }
Implements:
Gets the parent node of the current node.
[Browsable(false)]
public RadSiteMapNode ParentNode { get; }
The parent node. If the the node is a root node null (Nothing) is returned.
protected override IDictionary<string, string> PropertyMappings { get; }
Overrides:
Gets or sets a value indicating whether the node is selected.
public bool Selected { get; set; }
True if the node is selected; otherwise false. The default value is
false.
Only one node can be selected.
Gets or sets the Cascading Style Sheet (CSS) class applied when node is selected.
[ClientPersistedProperty]
public string SelectedCssClass { get; set; }
By default the visual appearance of selected nodes is defined in the skin CSS file. You can use the SelectedCssClass property to specify unique appearance for a node when it is selected.
Gets or sets a value specifying the URL of the image rendered when the node is selected.
[ClientPersistedProperty]
public string SelectedImageUrl { get; set; }
If the
SelectedImageUrlproperty is not set the ImageUrl property will be used when the node is selected.
Gets or sets the separator template for the node.
[TemplateContainer(typeof(RadSiteMapNode))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public ITemplate SeparatorTemplate { get; set; }
An object implementing the ITemplate interface. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.
To specify common display for all nodes use the SeparatorTemplate property.
The separator is rendered only in Flow mode.
Gets the RadSiteMap which this node belongs to.
[Browsable(false)]
public RadSiteMap SiteMap { get; }
The RadSiteMap which this node belongs to; null (Nothing) if the node is not added to any RadSiteMap control.
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets or sets the target window or frame in which to display the Web page content associated with the current node.
[TypeConverter(typeof(TargetConverter))]
[ClientPersistedProperty]
public override string Target { get; set; }
The target window or frame to load the Web page linked to when the node is clicked. Values must begin with a letter in the range of a through z (case insensitive), except for the following special values, which begin with an underscore:
| _blank | Renders the content in a new window without frames. |
| _parent | Renders the content in the immediate frameset parent. |
| _self | Renders the content in the frame with focus. |
| _top | Renders the content in the full window without frames. |
The default value is empty string which means the linked resource will be loaded in the current window.
Overrides:
Use the Target property to target window or frame in which to display the Web page content associated with the current node. The Web page is specified by the NavigateUrl property.
If this property is not set, the Web page specified by the NavigateUrl property is loaded in the current window.
The Target property is taken into consideration only when the NavigateUrl property is set.
Gets or sets the text displayed for the current node.
[ClientPersistedProperty]
public override string Text { get; set; }
The text displayed for the node in the RadSiteMap control. The default is empty string.
Overrides:
Use the Text property to specify or determine the text that is displayed for the node in the RadSiteMap control.
Gets or sets the tooltip shown for the node when the user hovers it with the mouse
[ClientPersistedProperty]
public override string ToolTip { get; set; }
A string representing the tooltip. The default value is empty string.
Overrides:
The ToolTip property is also used as the alt attribute of the node image (in case ImageUrl is set)
Gets or sets custom (user-defined) data associated with the current node.
[ClientPersistedProperty]
public override string Value { get; set; }
A string representing the user-defined data. The default value is emptry string.
Overrides:
Use the Value property to associate custom data with a RadSiteMap object.
Methods
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
protected override ControlItemCollection CreateChildItemCollection()
Overrides:
Removes the node from the Nodes collection of its parent
public void Remove()
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
Renders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers.
public override void RenderEndTag(HtmlTextWriter writer)
A HtmlTextWriter that represents the output stream to render HTML content on the client.
Overrides:
protected override void SetItemContainer(ControlItemContainer itemContainer)
Overrides: