This question is locked. New answers and comments are not allowed.
I have a conditional statement that changes the CSS class to render a specific icon when the condition is met. This works flawlessly on the root parents nodes. When the Ajax call is made to load the child elements, the SpriteCssClasses attribute it set correctly however it does not render the icon in the tree. Note: Even when I remove the conditional and always set the child nodes to render the icon, the icon does not appear.
IEnumerable nodes = from item
in
treeItems
select
new
TreeViewItem
{
Text = item.Name,
Value = item.RelativePath,
LoadOnDemand = item.HasChildren,
Enabled =
true
,
ImageUrl = (item.ItemType == TreeItem.Type.Folder)
? Url.Content(
"~/Content/Images/folder.png"
)
: Url.Content(
"~/Content/Images/file.png"
),
SpriteCssClasses = (item.HasBeenMigrated)
?
"migratedFile"
:
null
,
Checkable = IsCheckable(item),
Checked = (ps2CheckedNodes !=
null
)
? (ps2CheckedNodes.Where(e =>
e.Value.Equals(treeItem.RelativePath))
.FirstOrDefault() !=
null
) :
false
};