Results 1 to 3 of 3

Thread: class question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89

    class question

    Hi,

    i'm writing a custom treeview object where each node has a reference to a respective dataset row. I'm creatinga subclass as follows

    Class NewNode
    Inherits TreeNode
    public row as datarow

    Public Sub New(r as datarow)
    MyBase.new()
    row = r
    Me.Text = r.item("Text")
    End Sub
    End Class

    now for a example i add a row as follows:

    public sub addnode(row as datarow)
    treeview1.nodes.add(new newnode())
    end sub

    Now the question is when i build a treeview object using my new node type is datarow object going to be present there as a reference to a dataset.table.row structure or is it going to be a datarow object i.e. if the row element contains alot of information and the tree is going to be quite big i don't want to keep it all inside of the treeview but i want to be able to have a reference to it.

    Regards

  2. #2
    Member HumanCompiler's Avatar
    Join Date
    Dec 2002
    Location
    Decatur, IN USA
    Posts
    52
    I've never actually created one before by you might want to look at creating your own Data Provider on top of the TreeView so that you could just set the DataSource to the DataTable's view and it would generate the tree for you...might be easier, might be harder than what you're trying to do...not sure!
    -Erik Porter
    .NET MVP

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    No I don't this is possible for the case, this is going to be a windows component which will be included in a parent application.

    There are some constraints for the position of the rows to be placed. One of the values of the Row object is a (ID) key value which is unique as well as ParentID value which acts as a foreign key (Circular reference). Any child treenode has a parent Treenode with ID = ParentID key value. Also the data in the table could be unsorted so there is a buffer which is checked after every successful insertion of a new node.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width