Sunday, 25 March 2012

Collapse All Node Except Selected Node in Asp.net Tree View

     protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)

    {
        foreach (TreeNode tn in TreeView1.Nodes)
        {
            tn.Collapse();
        }
        TreeView1.SelectedNode.Expand();
    

    }

No comments:

Post a Comment