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

Rendering issue on Treeview

4 Answers 76 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Young Kim
Top achievements
Rank 1
Young Kim asked on 06 Apr 2010, 04:14 PM
Hi.

I am having issue on treeview that when I expend treeview, it expand and push down other items to bottom of the treeivew.
it seems like other expanded nodes does not render correctly.
this happens when other node is already expanded.

Any idea?

Thanks

4 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 08 Apr 2010, 01:42 PM
Hello Young Kim,

What do you mean by 'not render correctly'? Can you please show us a screenshot of the problem?

Kind regards,
Dimitar Milushev
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
Young Kim
Top achievements
Rank 1
answered on 08 Apr 2010, 06:48 PM
here is the screen shot

Thanks
0
Dimitar Milushev
Telerik team
answered on 08 Apr 2010, 07:30 PM
Hi Young Kim,

I notice that there is a line break between the Node's image and the Node's text in some cases (for example the Q1 and Q2 nodes). Are you using a template or are you inserting HTML in the Nodes' text? Can you please send us a sample project or at least the markup of the template if you are using one? Also, since I don't see any downloads from your account, are you using the latest version of RadControls or an older version?

Regards,
Dimitar Milushev
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
Young Kim
Top achievements
Rank 1
answered on 08 Apr 2010, 08:52 PM
Hi.

I am using HTML when generating treeview.
since template is different from each level of hierarchy.

This happens on no matter how I bind. I have another page that uses treeview it does the same problem.
We have different user account for the license.
I am using Version 2009.3.1314.35

Thanks

 trvQuestionGroup.Nodes.Clear(); 
            foreach (QuestionGroupEntity questionEntity in QuestionGroupDataSource){ 
                RadTreeNode node = new RadTreeNode(questionEntity.QuestionGroupText, questionEntity.Id.ToString()); 
                if (questionEntity.Questions != null){ 
                    foreach (QuestionEntity item in questionEntity.Questions.OrderBy(q => q.ItemOrder)){ 
                        RadTreeNode childNode = new RadTreeNode(GetQuestionText(item), item.Id.ToString()); 
                        childNode.Category = "q"
                        childNode.ContextMenuID = "questionContextId"
                        node.Nodes.Add(childNode); 
                    } 
                } 
                node.Category = "qg"
                node.ContextMenuID = "questionGroupContextId"
                trvQuestionGroup.Nodes.Add(node); 
            } 
  private string GetQuestionText(QuestionEntity entity){ 
            string textFormat = 
                "<div class='questionMain'>{0}{1}{2}<div class='clearDiv'></div><div class='questionTrvText'>{3}</div></div>"
            string imageFileName; 
            string showCommentFileName = String.Empty; 
            string requiredFileName = String.Empty; 
            if (entity.ShowComment) 
                showCommentFileName = 
                    "<div class='questionIcon'><img src='../../Images/showcomment.gif' alt='Show Comment'/></div>"
            if (entity.IsRequired) 
                requiredFileName = 
                    "<div class='questionIcon'><img src='../../Images/required.gif' alt='Required'/></div>"
            switch (entity.QuestionType){ 
                case QuestionTypeEnum.CheckBox: 
                    imageFileName = 
                        "<div class='questionIcon'><img src='../../Images/checkbox.gif' alt='Checkbox List'/></div>"
                    break; 
                case QuestionTypeEnum.RadioButton: 
                    imageFileName = 
                        "<div class='questionIcon'><img src='../../Images/radio.gif' alt='Radiobutton List'/></div>"
                    break; 
                default: 
                    imageFileName = 
                        "<div class='questionIcon'><img src='../../Images/textbox.gif' alt='TextBox'/></div>"
                    break; 
            } 
 
            return String.Format(textFormat, imageFileName, showCommentFileName, requiredFileName, entity.Title); 
        } 
<telerik:RadTreeView ID="trvQuestion" runat="server" Height="500px" EnableDragAndDrop="true" 
                EnableDragAndDropBetweenNodes="true" OnClientNodeDropping="onQuestionNodeDropping" 
                OnClientContextMenuItemClicking="contextMenuItemClicking" OnNodeDrop="trvQuestion_NodeDrop" 
                OnClientContextMenuShowing="onClientContextMenuShowing" OnContextMenuItemClick="trvQuestion_ContextItemClicked"
                <ContextMenus> 
                    <telerik:RadTreeViewContextMenu ID="QuestionItemMenuId" runat="server"
                        <Items> 
                            <telerik:RadMenuItem Value="Remove" Text="Remove" ImageUrl="~/Images/Delete.gif"
                            </telerik:RadMenuItem> 
                        </Items> 
                    </telerik:RadTreeViewContextMenu> 
                    <telerik:RadTreeViewContextMenu ID="QuestionMenuId" runat="server"
                        <Items> 
                            <telerik:RadMenuItem Value="Edit" Text="Edit" ImageUrl="~/Images/Edit.gif"
                            </telerik:RadMenuItem> 
                        </Items> 
                    </telerik:RadTreeViewContextMenu> 
                </ContextMenus> 
            </telerik:RadTreeView> 

Tags
TreeView
Asked by
Young Kim
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Young Kim
Top achievements
Rank 1
Share this question
or