Home - Forums-.NET - FlyTreeView (ASP.NET) - FlyTreeNodeItem.Node is null

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

FlyTreeNodeItem.Node is null
Link Posted: 18-Aug-2008 17:18
Hi,

Hi, I have a button in my content template for a type of node, and a handler in the server code.

When the user clicks the button I am try to do get  handle back to my Node so I get it's value property by doing.

FlyTreeNode myNode = ((FlyTreeNodeItem)(((Control)(sender)).BindingContainer)).Node;

myNode is null.

If I look at the FlyTreeView object, I can see all the nodes in the node collection.

Why is this? If this is not correct, what is the way to get back to my Node?

Thanks,
Rich
Link Posted: 18-Aug-2008 22:45
Rich,

This looks like a bug. We investigated control code, and it really looks like a bug (FlyTreeNodeItem.Node is not set in some cases). We have a fix for it, but have no test case to make sure that this really fixes the bug.

Do you have a small test page that reproduces the problem? Just put its code here. Then we'll be able to check it with new FlyTreeView and publish new version if it fixes your issue.
Link Posted: 19-Aug-2008 05:47
I quickly modified and copied the code I'm using. You'll have to populate the tree with at least one node...

Thanks,
Rich


OnNodeSelected="tvCostCodeProductTreeSearchResults_NodeSelected" OnPopulateNodes="tvCostCodeProductTreeSearchResults_PopulateNodes"
CssClass="UGFramestyleSelectable"  SelectNodeOnRightClick="false"
OnNodeDataBound="tvCostCodeProductTreeSearchResult_NodeDataBound"
OnNodeExpandedChanged="tvCostCodeProductTreeSearchResult_NodeExpandedChanged" Width="600px" >

    
        
                      
                    
            
              
            
        
          
        
    



protected void tvCostCodeProductTreeSearchResults_NodeSelected(object sender, FlyTreeNodeEventArgs e)
    {

        
    }

    protected void tvCostCodeProductTreeSearchResults_PopulateNodes(object sender, FlyTreeNodeEventArgs e)
    {
      
    }

    protected void PopulatePriceForCostCodeProductNode(FlyTreeNode productNode)
    {
        

    }

    protected void tvCostCodeProductTreeSearchResult_NodeDataBound(object sender, NineRays.WebControls.FlyTreeNodeEventArgs e)
    {
      
    

    }

    protected void tvCostCodeProductTreeSearchResult_NodeExpandedChanged(object sender, NineRays.WebControls.FlyTreeNodeEventArgs e)
    {

      

    }

    protected void btnCostCodeProductAddPrice_Click(object sender, EventArgs e)
    {
        //((Button)sender).
        FlyTreeNode productNode = ((FlyTreeNodeItem)(((Control)(sender)).BindingContainer)).Node;

      


    }
Link Posted: 19-Aug-2008 06:12
Yes, this is it.
Fixed build is now available at Downloads
Link Posted: 12-Sep-2008 09:59
Thanks EvgenyT,

This release fixed my issue.

Rich