KaxMenuItemDataBound Event |
Occurs after a menu item is data bound.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax public event KaxMenuEventHandler ItemDataBound
Public Event ItemDataBound As KaxMenuEventHandler
public:
event KaxMenuEventHandler^ ItemDataBound {
void add (KaxMenuEventHandler^ value);
void remove (KaxMenuEventHandler^ value);
}
member ItemDataBound : IEvent<KaxMenuEventHandler,
KaxMenuEventArgs>
Value
Type:
Kettic.AspNet.ControlsKaxMenuEventHandlerRemarks
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();
}
Sub KaxMenu1_ItemDataBound(ByVal sender As Object, ByVal e As KaxMenuEventArgs) Handles KaxMenu1.ItemDataBound
Dim item As KaxMenuItem = e.KaxMenuItem
Dim dataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
item.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
item.NavigateUrl = dataRow("URL").ToString()
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also