#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Aug 2007
    Posts
    22
    Rep Power
    0

    Select (highlight) an item in treeview


    I have a treeview looking something like this


    Start
    --A
    ------1
    ------2
    ------3
    --B
    ------4
    ------5
    --C
    ------6


    I want to highlight an item, like item 5. How can I do this? If I add the attribute SelectedNodeStyle-CssClass="SelectedNodeStyle", nothing happens.

    if I add OnSelectedNodeChanged="TreeView1_SelectedNodeChang ed" with the following code:
    Code:
    	protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    	{
    		TreeView1.SelectedNode.Selected = true;
    	}
    In that case only the parentnode gets selected, like A, B or C, but not the item itself. How can I make visible what choise the user has made.
    Last edited by Will-O-The-Wisp; May 5th, 2015 at 11:21 AM.
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,665
    Rep Power
    283
    your question for .net forum, but check out atricle c# - How to highlight Tree path of selected node in TreeView control? - Stack Overflow
    it is explained pretty clear

    Comments on this post

    • Will-O-The-Wisp agrees
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

Similar Threads

  1. Select List Highlight Help
    By adam678 in forum HTML, JavaScript And CSS Help
    Replies: 3
    Last Post: October 9th, 2008, 03:14 PM
  2. Add item to select using window.opener
    By jamescw in forum ASP Development
    Replies: 1
    Last Post: August 15th, 2006, 05:36 AM
  3. Select(highlight) database values into a multiple ListBox
    By abbendix in forum .NET Development
    Replies: 1
    Last Post: July 6th, 2004, 09:28 AM
  4. Using SQL to 'select' a listbox item
    By Thisgirl in forum .NET Development
    Replies: 1
    Last Post: May 7th, 2004, 05:55 PM
  5. Replies: 0
    Last Post: March 15th, 2004, 04:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo