This is a migrated thread and some comments may be shown as answers.

SpriteCssClasses not being rendered on child nodes loaded via Ajax

4 Answers 37 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Emily Hatch
Top achievements
Rank 1
Emily Hatch asked on 01 Dec 2010, 06:34 PM
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 
                     };

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 Dec 2010, 04:29 PM
Hello Emily,

Thank you for pointing that out. The attached build resolves this problem.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Emily Hatch
Top achievements
Rank 1
answered on 06 Dec 2010, 06:26 PM
The fix works great.  Thank you!
0
iberry
Top achievements
Rank 1
answered on 06 Jul 2011, 03:59 PM
I'm getting this issue with version  2011.2.629.235.  The span tag for the sprite is not rendered when the child nodes are loaded via ajax.

0
Dimo
Telerik team
answered on 07 Jul 2011, 08:39 AM
Hello Ian,

I cannot reproduce such an issue with our latest builds. Can you please send a runnable demo?

Kind regards,
Dimo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TreeView
Asked by
Emily Hatch
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Emily Hatch
Top achievements
Rank 1
iberry
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or