RadNavigation
Choose a binding strategy:
- Hierarchical data source (e.g.
SiteMapDataSource) – no need to set DataFieldID / DataFieldParentID.- Flat self-referencing collection – must set both DataFieldID and DataFieldParentID.
Templates: a node picks the first available in priority: its own NodeTemplate then the control-level NodeTemplate then (optionally) ClientNodeTemplate for client rendering.
ContentTemplate vs child nodes: a ContentTemplate cannot coexist with child nodes; an attempt leads to a
NavigationNodeTemplateException.Performance tips: limit depth via MaxDataBindDepth for large hierarchies; defer heavy template logic to client where suitable.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[EmbeddedSkin("Navigation", typeof(RadNavigation))]
[EmbeddedSkin("Navigation", "Default", typeof(RadNavigation))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadNavigation))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredScript(typeof(jQueryPlugins), 1)]
[RequiredScript(typeof(DropDown), 2)]
[RequiredScript(typeof(MaterialRipple))]
[ClientScriptResource("Telerik.Web.UI.RadNavigation", "Telerik.Web.UI.Navigation.RadNavigationScripts.js")]
[ToolboxBitmap(typeof(RadNavigation), "Toolbox.Icons.Navigation.png")]
[TelerikToolboxCategory("Navigation")]
public class RadNavigation : RadDataBoundControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, INavigationNodeContainer
Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlRadNavigation...
Implements:
Inherited Members
Constructors
public RadNavigation()
Properties
Gets the object that controls the Wai-Aria settings applied on the control's element.
[PersistenceMode(PersistenceMode.InnerProperty)]
public NavigationWaiAriaSettings AriaSettings { get; }
Supplies an inline client-side template (Kendo templating syntax) applied to each node after data binding on the client.
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
public virtual string ClientNodeTemplate { get; set; }
Executed in the browser; use when you need dynamic HTML without server round trips.
Has access to fields declared via DataKeyNames or normal node properties (e.g.
#= Text #).Does not override server templates (NodeTemplate) already rendered.
Gets the settings for the animation played when the dropdown closes.
[PersistenceMode(PersistenceMode.InnerProperty)]
public AnimationSettings CollapseAnimation { get; }
An AnimationSettings that represents the collapse animation.
Use the CollapseAnimation property to customize the expand animation of RadNavigation. You can specify the Type and Duration. To disable collapse animation effects you should set the Type to AnimationType.None.
To customize the expand animation you can use the ExpandAnimation property.
The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()
protected override string CssClassFormatString { get; }
Overrides:
Gets or sets the data field holding the unique identifier for a NavigationNode.
public virtual string DataFieldID { get; set; }
The data field ID.
Gets or sets the data field holding the ID of the parent NavigationNode.
public virtual string DataFieldParentID { get; set; }
The data field parent ID.
Gets or sets an array of data-field names that will be used to populate the NavigationNode 's DataItem property which is used to populated the control's template.
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[TypeConverter(typeof(ListConverter))]
[PersistenceMode(PersistenceMode.Attribute)]
public virtual string[] DataKeyNames { get; set; }
An array that contains the names of the fields contained in the RadNavigation's DataItem property.
Note: The dataItem's properties declared in the template should be with lower case .
Gets or sets the data field holding the Navigation URL property for the currently bound NavigationNode.
public virtual string DataNavigateUrlField { get; set; }
The data navigate URL field.
Gets or sets the data field holding the Text property for the currently bound NavigationNode.
public virtual string DataTextField { get; set; }
The data text field.
Gets or sets a value indicating how the NavigationNode's text should be formatted.
public virtual string DataTextFormatString { get; set; }
When set to true enables support for WAI-ARIA.
[ClientControlProperty]
[ClientPropertyName("enableAriaSupport")]
public bool EnableAriaSupport { get; set; }
Gets or sets a value indicating whether the screen boundary detection will be applied when menu items are expanded.
[ClientControlProperty]
[ClientPropertyName("enableScreenBoundaryDetection")]
public bool EnableScreenBoundaryDetection { get; set; }
By default RadNavigation will check if there is enough space to open a menu item. If there isn't the expand direction of the item will be inverted - Left to Right, Bottom to Top and vice versa.
Gets the settings for the animation played when the dropdown opens.
[PersistenceMode(PersistenceMode.InnerProperty)]
public AnimationSettings ExpandAnimation { get; }
An AnimationSettings that represents the expand animation.
Use the ExpandAnimation property to customize the expand animation of RadNavigation. You can specify the Type and Duration. To disable expand animation effects you should set the Type to AnimationType.None.
To customize the collapse animation you can use the CollapseAnimation property.
Gets or sets the image position.
public RadNavigationImagePostion ImagePosition { get; set; }
The image position.
Used to customize the Navigation keyboard navigation functionality.
[PersistenceMode(PersistenceMode.InnerProperty)]
public KeyboardNavigationSettings KeyboardNavigationSettings { get; }
Limits how many hierarchical levels are bound when data contains nested children (-1 binds all).
public virtual int MaxDataBindDepth { get; set; }
Use to prevent excessively deep trees from rendering for large data sets.
Set to 0 to bind only root nodes; 1 for root + direct children, etc.
Works with both hierarchical and self-referencing binding (see DataFieldID, DataFieldParentID).
Gets or sets the menuButton position.
public RadNavigationMenuButtonPostion MenuButtonPosition { get; set; }
The menuButton position.
Gets the Nodes.
[PersistenceMode(PersistenceMode.InnerProperty)]
public NavigationNodeCollection Nodes { get; }
The Nodes.
Implements:
Gets or sets template for all Nodes that doesn't have template nor does their Node.
[TemplateContainer(typeof(NavigationNode))]
[PersistenceMode(PersistenceMode.InnerDefaultProperty)]
public ITemplate NodeTemplate { get; set; }
The Node template.
Gets or sets the on client load.
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }
The on client load.
Gets or sets the on NavigationNode clicked.
[ClientControlEvent]
[ClientPropertyName("nodeClicked")]
public string OnClientNodeClicked { get; set; }
The on NavigationNode clicked.
Gets or sets the on NavigationNode clicking.
[ClientControlEvent]
[ClientPropertyName("nodeClicking")]
public string OnClientNodeClicking { get; set; }
The on NavigationNode clicking.
Gets or sets the on client Node collapsed.
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("nodeCollapsed")]
public string OnClientNodeCollapsed { get; set; }
The on client Node collapsed.
Gets or sets the on client Node collapsing.
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("nodeCollapsing")]
public string OnClientNodeCollapsing { get; set; }
The on client Node collapsing.
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("nodeExpanded")]
public string OnClientNodeExpanded { get; set; }
Gets or sets the on client Node expanding.
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("nodeExpanding")]
public string OnClientNodeExpanding { get; set; }
The on client Node expanding.
Gets or sets the name of the JavaScript function called when the mouse enters a node
[ClientControlEvent]
[ClientPropertyName("nodeMouseEnter")]
public string OnClientNodeMouseEnter { get; set; }
Gets or sets the name of the JavaScript function called when the mouse leaves a node
[ClientControlEvent]
[ClientPropertyName("nodeMouseLeave")]
public string OnClientNodeMouseLeave { get; set; }
Gets or sets the on NavigationNodes populated.
[ClientControlEvent]
[ClientPropertyName("nodesPopulated")]
public string OnClientNodesPopulated { get; set; }
The on NavigationNodes populated.
Gets or sets the on NavigationNodes populating.
[ClientControlEvent]
[ClientPropertyName("nodesPopulating")]
public string OnClientNodesPopulating { get; set; }
The on NavigationNodes populating.
Gets or sets the name of the JavaScript function called when the client template for a node is evaluated
[ClientControlEvent]
[ClientPropertyName("templateDataBound")]
public string OnClientTemplateDataBound { get; set; }
Gets the resolved render mode.
public override RenderMode ResolvedRenderMode { get; }
The resolved render mode.
Overrides:
protected override bool SupportsRenderingMode { get; }
Overrides:
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Methods
Binds a data source to the invoked server control and all its child controls.
public override void DataBind()
Overrides:
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
Finds the Node by text.
Finds the Node by URL.
Gets a linear list of all Nodes in the NavigationNode.
public IList<NavigationNode> GetAllNodes()
An IList<T> containing all Nodes (from all hierarchy levels).
protected override void PerformDataBinding(IEnumerable data)
Overrides:
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
Events
Occurs when NavigationNode is bound
public event NavigationNodeEventHandler NodeDataBound
Occurs before template is being applied to the Node.
public event NavigationNodeEventHandler 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.