Reading child nodes of a treeview

Discussion in 'ASP .Net Web Controls' started by David, Aug 12, 2007.

  1. David

    David Guest

    Hi all,

    I am using .NET 1.1 and Microsoft.Web.UI.WebControls.TreeView

    I am populating my treeview from a database and that is all working
    perfectly. Basically, what I want to do is to select certain records in the
    database to copy to another database (publish). For this, I have the
    checkboxes on each node. (I can check a node and all child nodes will be
    selected, to save time.)

    On my page, once I have selected the detail to publish, I have a
    "Publish..." button. However, when I click it, I cannot get the nodes that
    are selected. I am not sure where to start...

    I have tried starting at the root node, but there doesn't appear to be any
    node.childnodes or similar in order to get the children of the current node.

    Spent all day searching but struggling to find answers. :-(

    How do I do this?

    As a side question... when I have the selected details working, I want to
    just publish those rows. If anyone has any ideas on the best way to do this
    (probably using the current dataset somehow), it would be very much
    appreciated. (There will be some slight changes to the data, for example,
    data related by ID field, the ID field value will naturally change, so child
    data related ID value will have to change).

    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
    David, Aug 12, 2007
    #1
    1. Advertising

  2. David

    David Guest

    Doh!!!

    No sooner I post this than I work out how to do it.

    treenode.nodes is the same as a treenodecollection, which means that I can
    call a function while reading all the nodes, then pass the treenode.nodes
    into a function that expects the treenodecollection.

    Now that I have that, I somehow need to manage the data side of it (my side
    question).

    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available


    "David" <> wrote in message
    news:%...
    > Hi all,
    >
    > I am using .NET 1.1 and Microsoft.Web.UI.WebControls.TreeView
    >
    > I am populating my treeview from a database and that is all working
    > perfectly. Basically, what I want to do is to select certain records in
    > the database to copy to another database (publish). For this, I have the
    > checkboxes on each node. (I can check a node and all child nodes will be
    > selected, to save time.)
    >
    > On my page, once I have selected the detail to publish, I have a
    > "Publish..." button. However, when I click it, I cannot get the nodes that
    > are selected. I am not sure where to start...
    >
    > I have tried starting at the root node, but there doesn't appear to be any
    > node.childnodes or similar in order to get the children of the current
    > node.
    >
    > Spent all day searching but struggling to find answers. :-(
    >
    > How do I do this?
    >
    > As a side question... when I have the selected details working, I want to
    > just publish those rows. If anyone has any ideas on the best way to do
    > this (probably using the current dataset somehow), it would be very much
    > appreciated. (There will be some slight changes to the data, for example,
    > data related by ID field, the ID field value will naturally change, so
    > child data related ID value will have to change).
    >
    > --
    > Best regards,
    > Dave Colliver.
    > http://www.AshfieldFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Local franchises available
    >
    David, Aug 12, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    545
    Soren Kuula
    Aug 24, 2006
  2. Replies:
    1
    Views:
    1,187
    Joe Kesselman
    Nov 1, 2006
  3. Luqman
    Replies:
    2
    Views:
    846
    Luqman
    Jun 5, 2007
  4. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    429
    Steve Drake
    Oct 15, 2003
  5. bsg92056

    TreeView with child nodes

    bsg92056, Jul 19, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    119
    bsg92056
    Jul 19, 2005
Loading...

Share This Page