Click or drag to resize
KaxNavigationBarTemplateNeeded Event
Occurs before template is being applied to the panel item.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public event KaxNavigationBarEventHandler TemplateNeeded

Value

Type: Kettic.AspNet.ControlsKaxNavigationBarEventHandler
Remarks
The TemplateNeeded event is raised before a template is been applied on the panel item, both during round-trips (postbacks) and at the time data is bound to the control. The TemplateNeeded event is not raised for items which are defined inline in the page or user control.

The TemplateNeeded event is commonly used for dynamic templating.

Examples
The following example demonstrates how to use the TemplateNeeded event to apply templates with respect to the Value property of the panel items.
protected void KaxNavigationBar1_TemplateNeeded(object sender, Kettic.AspNet.Controls.KaxNavigationBarEventArgs e)
{
   string value = e.Item.Value;
   if (value != null)
   {
      // if the value is an even number
      if ((Int32.Parse(value) % 2) == 0)
      {
         var textBoxTemplate = new TextBoxTemplate();
         textBoxTemplate.InstantiateIn(e.Item);        
      }
   }
}
See Also