Hi EvgenyT,
Thanks for the reply. I'm not having any success doing this.
Previously my node's content template looked something like this:
... prices
I then changed it to
... prices
I tried several things but my last resort was to use my tree's OnPreRender event to go and set the text on this Literal object by doing...
protected void myTree_PreRender(object sender, EventArgs e)
{
foreach (FlyTreeNode node in myTree.Nodes)
{
//set price count label
if (node.ContentContainer != null)
{
Literal priceCountText = (Literal)node.ContentContainer.FindControl("ltPriceCount");
priceCountText.Text = node.Attributes["priceCount"];
}
}
}
The first time my tree renders, ContentContainer is NULL, so my code setting the text is never called. This is issue # 1 I have. When the tree shows initially, my price count is not shown...On subsequent renders of the tree, the ContentContainer now exists and my code to set the priceCount Literal is called, but again, the Text is never updated (issue #2).
What should I be doing instead? Be aware the way I am populating my tree is by doing:
myTree.Nodes.Add(productNode);
I never call DataBind() on my Tree.
My previous way of just outputting the count via worked, but I was never able to update the text properly. I would revert to this, but I also had found that I could never change the text of the node once it was set (my initial question in this thread). I ended up repopulating the tree, which was far from ideal.
Your suggestion of using a server control makes senses, but does not work at all for me.
Thanks,
Rich