M
Mike Collins
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?
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;
}
}
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?
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;
}
}