Click or drag to resize
KaxMenuItemDataBound Event
Occurs after a menu item is data bound.

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 KaxMenuEventHandler ItemDataBound

Value

Type: Kettic.AspNet.ControlsKaxMenuEventHandler
Remarks

The ItemDataBound event is raised for each menu item upon databinding. You can retrieve the item being bound using the event arguments. The DataItem associated with the item can be retrieved using the DataItem property.

The ItemDataBound event is often used in scenarios when you want to perform additional mapping of fields from the DataItem to their respective properties in the KaxMenuItem class.

Examples
The following example demonstrates how to map fields from the data item to item properties using the ItemDataBound event.
private void KaxMenu1_ItemDataBound(object sender, Kettic.AspNetControls.KaxMenuEventArgs e)
{
    KaxMenuItem item = e.KaxMenuItem;
    DataRowView dataRow = (DataRowView) e.Item.DataItem;

    item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
    item.NavigateUrl = dataRow["URL"].ToString();
}
See Also