Welcome to Dream.In.Code
Become an Expert!

Join 150,116 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,962 people online right now. Registration is fast and FREE... Join Now!




Changing Treeview Selected Property

 
Reply to this topicStart new topic

Changing Treeview Selected Property

mikecollins
30 Jun, 2008 - 09:02 AM
Post #1

New D.I.C Head
*

Joined: 30 Jun, 2008
Posts: 1

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;
    }
}

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 01:13AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month