KaxToolBarButtonDataBound Event |
Occurs when a button is data bound.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic event KaxToolBarButtonEventHandler ButtonDataBound
Public Event ButtonDataBound As KaxToolBarButtonEventHandler
public:
event KaxToolBarButtonEventHandler^ ButtonDataBound {
void add (KaxToolBarButtonEventHandler^ value);
void remove (KaxToolBarButtonEventHandler^ value);
}
member ButtonDataBound : IEvent<KaxToolBarButtonEventHandler,
KaxToolBarButtonEventArgs>
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");
}
Sub KaxToolBar1_ButtonDataBound(ByVal sender As Object, ByVal e As Kettic.AspNet.Controls.KaxToolBarButtonEventArgs) Handles KaxToolBar1.ButtonDataBound
e.Button.ImageUrl = "~/ToolBarImages/tool" & CStr(DataBinder.Eval(e.Button.DataItem, "Text")) & ".gif"
e.Button.NavigateUrl = CStr(DataBinder.Eval(e.Button.DataItem, "URL"))
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