KaxToolBarButtonDataItem Property |
Gets the data item that is bound to the button
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic override Object DataItem { get; set; }
Public Overrides Property DataItem As Object
Get
Set
public:
virtual property Object^ DataItem {
Object^ get () override;
void set (Object^ value) override;
}
abstract DataItem : Object with get, set
override DataItem : Object with get, set
Property Value
Type:
Object
An Object that represents the data item that is bound to the button. The default value is null
(Nothing in Visual Basic), which indicates that the button is not bound to any data item. The
return value will always be null unless accessed within a
ButtonDataBound event handler.
Remarks
This property is applicable only during data binding. Use it along with the
ButtonDataBound event to perform additional
mapping of fields from the data item to
KaxToolBarButton properties.
Examples
The following example demonstrates how to map fields from the data item to
KaxToolBarButton properties. It assumes the user has subscribed to the
ButtonDataBound event.
private void KaxToolBar1_ButtonDataBound(object sender, Kettic.AspNet.Controls.KaxToolBarButtonEventArgs e)
{
e.Button.ImageUrl = "image" + (string)DataBinder.Eval(e.Button.DataItem, "ID") + ".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 = "image" & DataBinder.Eval(e.Button.DataItem, "ID") & ".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