I searched the forums with no luck, so here is my question.
Is there a way to turn off the highlighting when a tree node is clicked on (selected)?
My tree is color coded by node level and clicking on a parent node to expand it changes the color of that node to the default highlight color, which I don't want. This is a read-only type tree, for information only, so I don't need to select a row and highlight it to show that it is the selected row.
I tried setting FullRowSelect to false, but it still highlights the row. In case it helps, the view style is Outlook Express with multiple columns.
Thans again, Mike. I will look into the StyleManager. I am very new to the Infragistics controls so I have yet to come across the StyleManager yet. There is a lot to learn, which means they are feature rich controls. That is a good thing.
On the other, I am not referencing the ActiveNodeAppearance anywhere. What I am doing is building nodes programmatically before adding them to the tree, and in that code I am using nodeA.NodeAppearance.BackColor = .... and other similar NodeAppearance code. I don't know if this would cause the highlighting effect when I click on the expand + sign or not. If I can find some time later, I'll experiment with it a bit. For now, it is working great as is, and I appreciate your help. I have a lot to learn about these neat controls.
Hi,
An isl file is an Application Style Library used to style your whole application. Just search your code for "StyleManager". If you are using an isl file, it would be loaded by calling the StyleManager.Load method. So if your code has no refefences to the StyleManager, you can rule that out.
Sorry for being so vague about the appearance property. the one I meant is the ActiveNodeAppearance, which is on the Override object (not the ColumnSet). There are Overrides on several objects in the tree, so you could be setting this on the tree itself:
this.ultraTree1.Override.ActiveNodeAppearance
At a particular level of the hierarchy:
this.ultraTree1.NodeLevelOverrides[0].ActiveNodeAppearance
On a nodes collection:
this.ultraTree1.Nodes.Override.ActiveNodeAppearance
Or on any individual node:
this.ultraTree1.Nodes[x].Override.ActiveNodeAppearance
Thanks for the reply, Mike. Please excuse my ignorance, but I'm not sure I understand completely what you mean by ActiveAppearance. ActiveAppearance doesn't exist anywhere in the code. I am using a commonColumnSet that has some Appearance settings such as:
commonColumnSet.ColumnHeaderAppearance.BackColor =
Color.Gold;
and
commonColumnSet.Columns[1].CellAppearance.TextHAlign =
HAlign.Right;
Is that what you are talking about? If those lines are causing the effect you mentioned, then I would have to use the workaround I described above because I need those appearances to make it look right.
As for an isl file, I don't think I am using that as I can't find one anywhere in the solution. At this time, I don't even know what an isl file is, but I will research it.
How you turn this off depends on why it's happening in the first place.
It is not the default behavior of the tree to highlight a node when you click on the expansion indicator for that node.
Clicking the expansion indicator does make the node the ActiveNode. So your tree probably has an ActiveAppearance applied to the nodes either in the code or via Application Styling. the easiest way to find out which one is to turn off AppStyling and see if the problem goes away. Just comment out your code that calls StyleManager.Load.
If this is happening because you are setting the Appearance in code, then don't set it (or reset it).
If this is happening because of AppStyling, then the best way to get around it is to remove that styling from the isl file you are using.
Well, I stumbled across a fix for this after I had moved on to some more fine tuning of the tree.
I set the UltraWinTree.ColumnSettings.AllowCellEdit = AllowCellEdit.Disabled, which turned off the highlighting of the row when I clicked on the + sign to expand the node.
But then this changed the text color to a dark gray, which I discovered is the default disabled foreground color. So I then set the ForeColorDisabled = Color.MidnightBlue to change the text color to what I wanted and it looks great now.
So many methods and properties. It's a good thing, but hard to find the ones you need in the right combinations sometimes.