Is there any way to set the CSS class for visited links? I have an inital css class, then it switches to something else for the SelectedCSSClass, but I don't see any way to set the color of the text for a visited link that is not currently selected. (It does not revert back to the original css class.)
Just so you see what I'm talking about, here's one of the nodes...
<ig:DataTreeNode NavigateUrl="mypage.aspx" Target="default_content" Text="Reports" CssClass="MyNodeCSS" SelectedCssClass="MySelectedNodeCSS">
</ig:DataTreeNode
Hello allison_musche,
Thank you for posting in our forum.
You can set a default style for the tree via the CssClass property and add different settings depending on the state of the nodes. For example if you set CssClass="MyNodeCSS" for a node you can then define separate classes for the different states of that node. For example:
.MyNodeCSS
{
color: Red;
}
. MyNodeCSS:visited
color: Green;
.MyNodeCSS:hover
color: Purple;
So the visited links will appear green.
Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Excellent, thank you!
I do have one follow up question, if you don't mind... "MyCSSClass" and "MySelectedCSSClass" are supposed to have two different colors, but it appears not to work? It always stays the color in MyCSSClass. (Font size changes don't work either. Text-decoration does, however.) Do not all propertiies work in the SelectedCSSClass?
Hello allison_musche ,
Have you enabled the selection for the tree? In general if the SelectionType property of the tree is not set ,then by default it will be “None” which means that selection will be disabled so the selected class won’t be applied when you click on a node. You can set that property to "Single" or "Multiple".
Also selection would not be persisted if you navigate out of the page and then return, since in that case the tree will be reloaded.
Yes, it's set to single. And, as I said, the text-decoration part DOES work - I put in an underline, just to see if the SelectedCSSClass was being applied and when. So I have:
MyCSSClass
color: blue;
MySelectedCSSClass
color: red;
text-decoration: underline;
When the tree is first drawn, the nodes are blue. When I click on a node, it DOES become underlined, but it does NOT turn red - it stays blue. Can't you set the color in the SelectedCSSClass?
I’m glad to hear you were able to solve your original issue.
If you happen to return to this I’ve attached a sample for your reference where
the selected style has a color set with !important tag which overwrites all other color settings for the selected node in the tree. You can refer to it and let me know if I’m missing anything from your scenario.
Sadly, not really! I sort of abandoned doing the color as it was eating up way more time than it was worth! I did try the !important bit, but it didn't work for me. At least my original issue was resolved though, it's fine for now unless the customer insists on something different. Thanks!
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Developer Support Engineer
You could set !important tag for the color in the selected style so that it takes priority over any other style that’s currently applied on a node:
.MySelectedCSSClass
color: red !important;
Let me know if that would solve your issue.
The problem, apparently, is that when you put in the "visited" css (like your original answer), it seems to overwrite the color of the selected style. Use your example and just add this, and you'll see the color won't change. (Or if it does, only for a second.) Is there any way for it to keep the Selected style until you click on a diffferent node??? If you don't set the visitied, it DOES keep the Selected style until you click on a different node - but then it applies the default visited style (mine are hyperlinks, so a different color entirely) and I need them to continue looking like all other "not currently selected" nodes, not like visited hyperlinks.
.MyCSSClass:visited
color: Blue;