Click or drag to resize
KaxMenuItemDataItem Property
Gets or sets the data item represented by the 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 override Object DataItem { get; set; }

Property Value

Type: Object
An object representing the data item to which the Item is bound to. The DataItem property will always return null when accessed outside of MenuItemDataBound event handler.
Remarks
This property is applicable only during data binding. Use it along with the MenuItemDataBound event to perform additional mapping of fields from the data item to KaxMenuItem properties.
Examples
The following example demonstrates how to map fields from the data item to KaxMenuItem properties. It assumes the user has subscribed to the MenuItemDataBound:KaxMenu.MenuItemDataBound event.
private void KaxMenu1_MenuItemDataBound(object sender, Kettic.AspNetControls.ItemStripEventArgs e)
{
    KaxMenuItem item = e.Item;
    DataRowView dataRow = (DataRowView) e.Item.DataItem;

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