KaxNavigationItemDataItem Property |
Gets or sets the data item represented by the item.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax public 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 representing the data item to which the Item is bound to. The
DataItem property will always return
null when
accessed outside of
ItemDataBound
event handler.
Remarks
This property is applicable only during data binding. Use it along with the
ItemDataBound event to perform
additional mapping of fields from the data item to
KaxNavigationItem properties.
Examples
The following example demonstrates how to map fields from the data item to
%
KaxNavigationItem properties. It assumes the user has subscribed to
the ItemDataBound:KaxNavigationBar.ItemDataBound
event.:KaxNavigationItem%
private void KaxNavigationBar1_NavigationItemDataBound(object sender, Kettic.AspNetControls.KaxNavigationBarEventArgs e)
{
KaxNavigationItem item = e.Item;
DataRowView dataRow = (DataRowView) e.Item.DataItem;
item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
item.NavigateUrl = dataRow["URL"].ToString();
}
Sub KaxPanel1_NavigationItemDataBound(ByVal sender As Object, ByVal e As KaxNavigationBarEventArgs) Handles KaxNavigationBar1.ItemDataBound
Dim item As KaxNavigationItem = e.Item
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