Treeview selectednode gives null

2 posts, 1 answers
  1. Mano srinivasan
    Mano srinivasan avatar
    11 posts
    Member since:
    Oct 2009

    Posted 02 Dec 2009 Link to this post

    Hi,

    I am using radtreeview in my application, in the nodeclick event,

    radtreeview.slectednode.value gives null reference exception.

    what should i do.

    <telerik:RadTreeView ID="RadTreeView1" runat="server" ShowLineImages="False" CheckBoxes="True"  OnNodeClick="RadTreeView1_NodeClick">
     </telerik:RadTreeView>

     protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            try
            {
                string str = RadTreeView1.SelectedNode.Value;
            }
            catch
            {
            }

            Response.Redirect("member.aspx?member=" + str);
        }

    thanks,
    mano
  2. Answer
    Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 02 Dec 2009 Link to this post

    Hello,

    e.Node will have a reference to currently clicked node.

    <telerik:RadTreeView ID="RadTreeView1" runat="server" ShowLineImages="False" CheckBoxes="True"  OnNodeClick="RadTreeView1_NodeClick"
     </telerik:RadTreeView> 
     
     protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e) 
        { 
            try 
            { 
                string str = e.Node.Value; 
            } 
            catch 
            { 
            } 
     
            Response.Redirect("member.aspx?member=" + str); 
        } 
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top