Treeview DatafieldParentID Bind to Object whose property is a another object

Posted by user228777 on Stack Overflow See other posts from Stack Overflow or by user228777
Published on 2010-03-16T12:21:10Z Indexed on 2010/03/16 12:26 UTC
Read the original article Hit count: 215

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about asp