Click or drag to resize
KaxToolBarButtonDataBound Event
Occurs when a button 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 KaxToolBarButtonEventHandler ButtonDataBound

Value

Type: Kettic.AspNet.ControlsKaxToolBarButtonEventHandler
Remarks

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

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

Examples
The following example demonstrates how to map fields from the data item to button properties using the ButtonDataBound event.
protected void KaxToolBar1_ButtonDataBound(object sender, Kettic.AspNet.Controls.KaxToolBarButtonEventArgs e)
{
    e.Button.ImageUrl = "~/ToolBarImages/tool" + (string)DataBinder.Eval(e.Button.DataItem, "Text") + ".gif";
    e.Button.NavigateUrl = (string)DataBinder.Eval(e.Button.DataItem, "URL");
}
See Also