Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:55:09+00:00 2026-05-22T14:55:09+00:00

How can I highlight the selected TreeNode (UI.WebControls) in ASP.NET? The purpose is to

  • 0

How can I highlight the selected TreeNode (UI.WebControls) in ASP.NET? The purpose is to let the user see which category he or she is viewing at the time.

My thought was that on each TreeNode, check if its property Selected was true and then change it’s font or something to another color. I’ve read about setting the “ForeColor”, but it doesn’t seem to exist for this type of TreeNode.

Another thought was to add some sort of JavaScript to each Node.

Just as an example, this is what the code looks like today:

private void BuildTree()
    {
        TreeNode nodeNew = new TreeNode("Unread", MessageFolder.New.ToString());

        TreeNode nodeProcessed = new TreeNode("Read", MessageFolder.Processed.ToString());

        TreeViewFolders.Nodes.Add(nodeNew);
        TreeViewFolders.Nodes.Add(nodeProcessed);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:55:10+00:00Added an answer on May 22, 2026 at 2:55 pm

    You have to work with the Server Control on the ASPX Page, you can specify the

    <asp:TreeView id="LinksTreeView"
                Font-Names= "Arial"
                ForeColor="Blue"
                SelectedNodeStyle-ForeColor="Green"
                SelectedNodeStyle-VerticalPadding="0"
                OnSelectedNodeChanged="Select_Change"   
                runat="server">
    

    Try this and for more info check this page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see this post on highlighting even columns but can I highlight only selected
Again i wonder how can i highlight selected item in my MainMenu form. Every
I have the following XAML. How can i highlight the selected item in the
How can I highlight all occurrence of a selected word in GVim, like in
is there an easy way to have a UITableView highlight which row is selected
I have an ASP.NET / C# application in which the Master Page contain the
How we can highlight selected row in a table using css. Is there any
I found this javascript code to highlight selected text, how can i add a
I'm trying to write a Google chrome extension so that I can highlight text
How can I highlight exactly one item (particularly a line on the x axis)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.