2.0 TreeNode

Discussion in 'ASP .Net Web Controls' started by William Sullivan, Apr 20, 2006.

  1. I've got a treeview that i'm filling using PopulateOnDemand (ajax calls).
    The TreeNode isn't sealed, so I thought I could extend it (call the new one
    SuperTreeNode) and add a bunch of data to the new node that I need to keep
    track of. But when the TreeNodePopulate event fires and I get the node from
    the TreeNodeEventArgs, it isn't the same node I put in the tree, its an
    actual TreeNode that just looks like my SuperTreeNode, minus all my important
    data. Is there any way to change this behavior? I suspect the problem lies
    in the javascript behind the call, so that leads me to believe that I don't
    have much chance to get around it. Would it be better to put my data in a
    custom HierarchicalDataSource? And if I do this, will I be able to figure
    out which of the datasource's nodes I need to fill from
    TreeNodeEventArgs.Node? TIA.
     
    William Sullivan, Apr 20, 2006
    #1
    1. Advertising

  2. William Sullivan

    Teemu Keiski Guest

    Hi,

    not 100% following what you mean? Is it that the kethod just returns your
    custom tree node by using base TreeNode type (polymorphism basics)

    Can you show a sample code snippet?

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke

    "William Sullivan" <> wrote in
    message news:...
    > I've got a treeview that i'm filling using PopulateOnDemand (ajax calls).
    > The TreeNode isn't sealed, so I thought I could extend it (call the new
    > one
    > SuperTreeNode) and add a bunch of data to the new node that I need to keep
    > track of. But when the TreeNodePopulate event fires and I get the node
    > from
    > the TreeNodeEventArgs, it isn't the same node I put in the tree, its an
    > actual TreeNode that just looks like my SuperTreeNode, minus all my
    > important
    > data. Is there any way to change this behavior? I suspect the problem
    > lies
    > in the javascript behind the call, so that leads me to believe that I
    > don't
    > have much chance to get around it. Would it be better to put my data in a
    > custom HierarchicalDataSource? And if I do this, will I be able to figure
    > out which of the datasource's nodes I need to fill from
    > TreeNodeEventArgs.Node? TIA.
     
    Teemu Keiski, Apr 21, 2006
    #2
    1. Advertising

  3. I've had to drop the idea and do manual data binding due to time limitations,
    and apparently I deleted the cs file with the tree in it. Thanks anyhow.


    "Teemu Keiski" wrote:

    > Hi,
    >
    > not 100% following what you mean? Is it that the kethod just returns your
    > custom tree node by using base TreeNode type (polymorphism basics)
    >
    > Can you show a sample code snippet?
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    > http://blogs.aspadvice.com/joteke
    >
    > "William Sullivan" <> wrote in
    > message news:...
    > > I've got a treeview that i'm filling using PopulateOnDemand (ajax calls).
    > > The TreeNode isn't sealed, so I thought I could extend it (call the new
    > > one
    > > SuperTreeNode) and add a bunch of data to the new node that I need to keep
    > > track of. But when the TreeNodePopulate event fires and I get the node
    > > from
    > > the TreeNodeEventArgs, it isn't the same node I put in the tree, its an
    > > actual TreeNode that just looks like my SuperTreeNode, minus all my
    > > important
    > > data. Is there any way to change this behavior? I suspect the problem
    > > lies
    > > in the javascript behind the call, so that leads me to believe that I
    > > don't
    > > have much chance to get around it. Would it be better to put my data in a
    > > custom HierarchicalDataSource? And if I do this, will I be able to figure
    > > out which of the datasource's nodes I need to fill from
    > > TreeNodeEventArgs.Node? TIA.

    >
    >
    >
     
    William Sullivan, Apr 21, 2006
    #3
    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. Aditi Deo via .NET 247
    Replies:
    0
    Views:
    371
    Aditi Deo via .NET 247
    Jun 5, 2004
  2. naijacoder naijacoder
    Replies:
    1
    Views:
    669
    naijacoder naijacoder
    Sep 15, 2004
  3. naija naija
    Replies:
    0
    Views:
    497
    naija naija
    Sep 28, 2004
  4. Patrick Olurotimi Ige
    Replies:
    2
    Views:
    537
    Patrick Olurotimi Ige
    Feb 15, 2005
  5. tanya foster
    Replies:
    3
    Views:
    3,737
    tanya foster
    May 18, 2006
Loading...

Share This Page