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);
}
You have to work with the Server Control on the ASPX Page, you can specify the
Try this and for more info check this page