New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
TemplateNeeded
Occurs before template is being applied to the navigation node.
The TemplateNeeded event handler receives two arguments:
-
The Navigation that is loading the nodes. This argument is of type object, but can be cast to the RadNavigation type.
-
An EventArgs object. This object has an Node property, which provides access to the node that expects receive a template. This node, in turn, has a NodeTemplate property, which has to be set.
ASPNET
<telerik:RadNavigation runat="server" ID="RadNavigation2" DataFieldID="id" DataKeyNames="Text" DataFieldParentID="parentID"
DataTextField="Text" OnTemplateNeeded="RadNavigation_TemplateNeeded">
</telerik:RadNavigation>
C#
protected void RadNavigation1_TemplateNeeded(object sender, NavigationNodeEventArguments e)
{
e.Node.NodeTemplate = new LabelDataBoundTemplate();
}