The DataItem property is available only during databinding in the ItemDataBound event:
| C# |
Copy Code |
|
protected void RadComboBox1_ItemDataBound(object o, RadComboBoxItemDataBoundEventArgs e) { DataRowView dataSourceRow = (DataRowView) e.Item.DataItem; ... } |
| VB.NET |
Copy Code |
|
Protected Sub RadComboBox1_ItemDataBound(ByVal o As Object, ByVal e As RadComboBoxItemDataBoundEventArgs) Dim dataSourceRow As DataRowView = CType(e.Item.DataItem,DataRowView) End Sub |
You should not use it elsewhere. You can use the Value property or Custom Attributes instead.