Treeview DatafieldParentID Bind to Object whose property is a another object
- by user228777
I am trying to bind Generic collection to a Rad Treeview control.
In following case CategoryCollection Returns collection of Category Object, which has bunch of properties and A Parent property which is a object and this parent object Has Id and text properties.
What I am trying to do is: I want to Bind DataFieldParentID of the tree view to CategoryCollection.Parent.Id. How do I do that?
Dim tvCategory As RadTreeView = DirectCast(cboCategory.Items(0).FindControl("tvCategory"), RadTreeView)
With tvCategory
.DataSource = CategoryCollection
.DataTextField = "Name"
.DataValueField = "ID"
.DataFieldID = "ID"
.DataFieldParentID = "Parent.ID"
.DataBind()
End With
Thank You