Home - Forums-.NET - FlyTreeView (ASP.NET) - SelectedNode is null

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

SelectedNode is null
Link Posted: 05-Mar-2007 03:24
1. I populate the tree with data only when not postback.
2. I select node by clicking on it.
3. Pressing submit button.
4. SelectedNode property of FlyTreeView on the server is null, why ?
Link Posted: 05-Mar-2007 11:14
What page lifecycle stage do you use to get SelectedNode?

Is it null at Page_Load handler?

Does your page keep node selected after postback? I mean do you have it selected in your treeview after page postback?
Link Posted: 05-Mar-2007 22:05
Yes, it is null at Page_Load stage.
I do not have it selected in my treeview after postback - it resets, Also SelectedNodeChanged event is not fired.

Here is the sample code I use:

    
        
        
            
            
            
        
    
    


Code behind

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // tree.SelectedNode is null when I select any node and press Button1
    }

    protected void tree_SelectedNodeChanged(object sender, NineRays.WebControls.SelectedNodeChangedEventArgs e)
    {
        // this event never fired
    }
}
Link Posted: 06-Mar-2007 06:11
Here is the simples code (actually mostly copy from yours): It works as it should here. [code] <%@ Register Assembly=\"NineRays.WebControls.FlyTreeView\" Namespace=\"NineRays.WebControls\" TagPrefix=\"nr\" %> protected void tree_SelectedNodeChanged(object sender, SelectedNodeChangedEventArgs e) { Button1.Text = e.Node.Text + \" was selected\"; } Untitled Page
[/code]
Link Posted: 06-Mar-2007 21:03
Thanks,
The error was in invalid master page.

Although may be it is the bug of FlyTreeView:

when I set ID of master page explicitly, FlyTreeView SelectedNode is always null:

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ID = \"M\";
        }
Link Posted: 07-Mar-2007 19:49
What if you change your code to
ID = \"M\";
base.OnInit(e);

?

So it first sets ID then calls default OnInit implementation.


We'll check it anyway, thanks.
Link Posted: 03-Jul-2007 02:14
No, it doesn't work.
Link Posted: 03-Jul-2007 04:22
Yes, this was a bug.
It was fixed.

Thanks for cooperation.
Link Posted: 24-Sep-2007 08:29
[quote="EvgenyT"]Yes, this was a bug.
It was fixed.

Thanks for cooperation.

How could I get the update if I have company license?
Link Posted: 24-Sep-2007 22:32
It depends on a subscription period.
You can try to go to downloads section and see if it is available to you.