Home All Groups Group Topic Archive Search About
Author
19 Apr 2006 11:38 PM
William Sullivan
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.

Author
21 Apr 2006 5:25 PM
Teemu Keiski
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

Show quoteHide quote
"William Sullivan" <WilliamSulli***@discussions.microsoft.com> wrote in
message news:AD200095-B537-4C29-8CC9-83C5F4DECE04@microsoft.com...
> 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.
Author
21 Apr 2006 8:11 PM
William Sullivan
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.


Show quoteHide quote
"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" <WilliamSulli***@discussions.microsoft.com> wrote in
> message news:AD200095-B537-4C29-8CC9-83C5F4DECE04@microsoft.com...
> > 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.
>
>
>