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 1000059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:27:05+00:00 2026-05-16T07:27:05+00:00

My code is : <asp:TreeView ID=TreeViewCategories runat=server ExpandDepth=0 Style=min-height: 200px; max-height: 500px; LineImagesFolder=~/TreeLineImages NodeIndent=0

  • 0

My code is :

            <asp:TreeView ID="TreeViewCategories" runat="server" ExpandDepth="0" Style="min-height: 200px;
                max-height: 500px;" LineImagesFolder="~/TreeLineImages" NodeIndent="0" LeafNodeStyle-CssClass="LeafNodesStyle"
                CssClass="TreeView" NodeStyle-CssClass="NodeStyle" ParentNodeStyle-CssClass="ParentNodeStyle"
                RootNodeStyle-CssClass="RootNodeStyle" SelectedNodeStyle-CssClass="SelectedNodeStyle"
                LeafNodeStyle-Width="100%" NodeStyle-Width="100%" ParentNodeStyle-Width="100%"
                RootNodeStyle-Width="100%" Font-Size="12pt">
                <Nodes>
                    <asp:TreeNode Text="All Items" SelectAction="Expand" PopulateOnDemand="True" Value="All Items" />
                </Nodes>
            </asp:TreeView>

css

.TreeView  
{
    border-bottom:1px dotted #B2B2B2 !important;
}

.TreeView div
{
    margin-left:5px;
}

.TreeView table
{
    border-top:1px dotted #B2B2B2 !important;
}

.TreeView div table
{
    border-bottom:none !important;
    border-top:none !important;
}

.TreeView table td
{
    padding:2px 0;
}

.LeafNodesStyle 
{

}

.RootNodeStyle 
{

}

/* ALL ELEMENTS */

.NodeStyle 
{

}

.ParentNodeStyle 
{
    /*background:yellow;*/
}

.SelectedNodeStyle { font-weight: bold; color:#6799D1; display:block; padding:2px 0 2px 3px; }

so I see (with firebug) for my selected node appears Visited style , node style , leaf style but not Selected node style 🙁

How to fix this HTML/CSS/ASP to make selected node Bold and Blue for example ?

Thank you.

added : adding nodes like here :

            foreach(c : Category in rootCategories)
            {
                mutable newNode : TreeNode = TreeNode(c.Title, c.Id);
                newNode.SelectAction = TreeNodeSelectAction.SelectExpand;
                newNode.NavigateUrl = "Items.aspx?catId=" + c.Id.ToString() + "&lvl=0";

solved with…

categoryId : string = Request.QueryString["catId"];
n : TreeNode = findNode(categoryId, TreeViewCategories.Nodes, lvl);
n.Selected = true;
  • 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-16T07:27:06+00:00Added an answer on May 16, 2026 at 7:27 am

    The SelectAction attribute on the asp:TreeNode is Expand change it to SelectExpand.

    This ensures that there is a postback and the tree control is redrawn to apply the seleceted node style that you set on the treeview

    <asp:TreeView ID="TreeViewCategories" runat="server" ExpandDepth="0" Style="min-height: 200px;
            max-height: 500px;" LineImagesFolder="~/TreeLineImages" NodeIndent="0" LeafNodeStyle-CssClass="LeafNodesStyle"
            CssClass="TreeView" NodeStyle-CssClass="NodeStyle" ParentNodeStyle-CssClass="ParentNodeStyle"
            RootNodeStyle-CssClass="RootNodeStyle" SelectedNodeStyle-CssClass="SelectedNodeStyle"
            LeafNodeStyle-Width="100%" NodeStyle-Width="100%" ParentNodeStyle-Width="100%"
            RootNodeStyle-Width="100%" Font-Size="12pt">
            <Nodes>
                <asp:TreeNode Text="All Items" SelectAction="SelectExpand" Value="All Items">
                    <asp:TreeNode Text="All Items" SelectAction="SelectExpand" Value="All Items" />
                    <asp:TreeNode Text="All Items" SelectAction="SelectExpand" Value="All Items" />
                    <asp:TreeNode Text="All Items" SelectAction="SelectExpand" Value="All Items" />
                </asp:TreeNode>
            </Nodes>
        </asp:TreeView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following code: <span style=margin:0px 2px 0px 2px;> <asp:Label ID=labelPromptText runat=server Text=Selected
When you have an ASP control like this: <asp:TreeView ID=TreeItems runat=server></asp:TreeView> The html that
The above is my ASP.NET code <asp:SiteMapDataSource ID=SiteMapDataSource1 runat=server /> <ul> <asp:Repeater runat=server ID=menuRepeater
My code Asp block: ---------- <ContentTemplate> <asp:Label runat=server ID=lblHelloWorld Text=label /> <br /> <asp:TextBox
I've used the following js code to expand/collapse all nodes of an ASP.Net TreeView
Writing Classic ASP code in JScript has a lot going for it: more humane
I have ajax code for asp.net (non-mvc) to call to a webMethod to get
I have somebody elses code (C# ASP.Net) which contains the following query: string query
I have the following shortened classic ASP code that makes a SQL insert call...
i write a simple webservice code in asp.net when i build the service and

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.