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

Treeview ChildNodes rendered to the right loadxml

1 Answer 59 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 21 Apr 2010, 12:31 PM

I have a problem using the RadTreeView which i can't figure out.

I want to create a treeview and load the content runtime as it changes depending on a selection made from a DropDownList.

I have no problem by loading the content, the problem is the styleing which i can't figure out how to control when loading the content runtime.

My HTML looks like this

<Telerik:RadTreeView runat="server" id="uiRadTreeView" Skin="Vista" Width="400px" > 
      
</Telerik:RadTreeView> 

My Code Behind looks like this

  uiRadTreeView.Nodes.Clear();     
    
            SPQuery manualQuery = new SPQuery();     
            manualQuery.Query = @"<Where><Eq><FieldRef Name='Client' /><Value Type='Lookup'>"+ uiClients.SelectedItem.Text +"</Value></Eq></Where>";     
    
            XmlDocument xmlDoc = new XmlDocument();     
    
            // Write down the XML declaration     
            XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0""utf-8"null);     
    
            // Create the root element     
            XmlElement rootNode = xmlDoc.CreateElement("Tree");     
            xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement);     
            xmlDoc.AppendChild(rootNode);                 
    
            SPListItemCollection manuals = SPContext.Current.Web.Lists["Manual"].GetItems(manualQuery);     
                 
            foreach (SPListItem manual in manuals)     
            {     
                     
                XmlElement parentNode = xmlDoc.CreateElement("Node");     
                     
                parentNode.SetAttribute("Text", manual.Title);                              
    
                SPFieldLookupValueCollection sops = new SPFieldLookupValueCollection(manual["SOP"].ToString());     
                     
                foreach (SPFieldLookupValue sop in sops)     
                {     
                    XmlElement childNode = xmlDoc.CreateElement("Node");     
                    childNode.SetAttribute("Text", sop.LookupValue.ToString());     
                    parentNode.AppendChild(childNode);     
                }     
    
                xmlDoc.DocumentElement.AppendChild(parentNode);     
            }     
    
               
    
            uiRadTreeView.LoadXml(xmlDoc.InnerXml);    
 

My Screen looks like see this link http://screencast.com/t/MDYxNTU5MzY

as yo can see from the screenshot i can't see the childnodes. When clicking on the Parent node the child nodes is rendered to the right. How do i force the childnodes to be rendered to the left ?

also how can i change the styling when adding content at runtime ?

thanks for your help

1 Answer, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 23 Apr 2010, 01:27 PM
Hello Martin ,

Thank you for contacting us.

This is a styling only issue by the looks of it, probably some global CSS rule is affecting the nodes. Can you send me a live URL, a sample project or at least all the CSS loaded on the page so that I can try and reproduce the issue here? Can you also specify the RadControls version you have and the browser you're using? Thank you in advance for your trouble.

Kind regards,
Kamen Bundev
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.
Tags
TreeView
Asked by
Martin
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Share this question
or