Changing Treeview property

Discussion in 'ASP .Net' started by Mike Collins, Jul 1, 2008.

  1. Mike Collins

    Mike Collins Guest

    I have six treeviews on a page. Each one is nested inside an accordion pane.
    When I click on a node, it turns yellow. When I click on a node in another
    tree, I would like the previous selected node to change back from yellow to
    its original color. The two different ways I have tried below do not work. Am
    I doing something wrong?

    Code:
    protected void tvAccountSetup_SelectedNodeChanged(object sender, EventArgs e)
    {
        string cssStyle = "color: #FFFFFF; background: none; 
    font-size:12pt;font-weight:bold;";
        tvProgram.SelectedNodeStyle.CssClass = cssStyle;
        if (tvProgram.SelectedNode != null)
        {
            tvProgram.SelectedNodeStyle.BackColor = System.Drawing.Color.Beige;
            tvProgram.SelectedNode.Selected = false;
        }
    }
    
    
    Mike Collins, Jul 1, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,456
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  2. abargaddon
    Replies:
    0
    Views:
    1,051
    abargaddon
    Jan 17, 2008
  3. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    461
    Steve Drake
    Oct 15, 2003
  4. Ionutz
    Replies:
    2
    Views:
    529
    Ionutz
    Oct 23, 2005
  5. stepkurt

    Microsoft Treeview vs System Treeview

    stepkurt, Aug 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    375
    Teemu Keiski
    Sep 2, 2007
Loading...

Share This Page