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

TreeView Node Item Width Problem

10 Answers 204 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
smith
Top achievements
Rank 1
smith asked on 16 Jan 2010, 09:42 AM

HI

 i am binding the TreeView  using Hierachical DataSource .
for my problem is  i Have Six Parent  nodes User  can add the child Parameter in  the Six Paraent nodes.
i gave color for all Parent Items (pls see the attachment)
When i  have add the Parameter Width of the ParentItem is Also increase . so color also increase in the node  it is look like ugly , i want if i add the Child parameter no need expand the width of the  Parent  Noides.
Pls see the Three  attachment
first one is before adding the child parmerter
second is after add the multiple Child Paramerer
third one is if remove the child parameter still in Same width.
how to fix the Node Width ?

10 Answers, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 18 Jan 2010, 02:32 PM
Hello smith,

Can you please, send us a sample application in which you encountered this problem?
We think that the problem is in the way you apply color to your Parent Nodes.

In the attached demo application you can find an alternative way to apply color to Parent Nodes. With the button you can add as many children of the first Parent Node as you wish.

Please, let us know if this helps you.

All the best,
Vladislav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Miroslav
Telerik team
answered on 18 Jan 2010, 02:56 PM
Hello smith,

Thank you for the screenshots, they demonstrate the problem.

I had a look at your question and I can suggest setting the HorizontalContentAlignment property to Left for the RadTreeViewItems.

Since the TreeView is databound it is best to assign an ItemContainerStyle that will set this property on the items.

Does this work for you?

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
smith
Top achievements
Rank 1
answered on 19 Jan 2010, 06:32 AM
HI

I tried for this but it is not worked

it is the problem in telerik Demo  also.

while adding the Parameter child node increase the width but parent node also change the width
how to fix the width for each raditem

pls see the  screen shot above post

Actually I am giving the Color Dynamically using ItemPrepared event
we cant set back ground  because it is not supporting DataBinding . so i am done there

e.PreparedItem.Background = color;

one more thing is  i seen the Wof application there they set it as back ground in xaml
also While select time select will come only the content it is going up to the width
based on the Treeitemcontent selected will come . it is look  ugly
how to resolve this issue .

0
Ivan
Telerik team
answered on 22 Jan 2010, 02:41 PM
Hi smith,

To get the desired result you should edit the TreeViewItem theme. Please give it a try and let us know if you need further assistance.

Regards,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
smith
Top achievements
Rank 1
answered on 22 Jan 2010, 03:14 PM
HI

i need one example for apply ng this
pls provide the result
0
smith
Top achievements
Rank 1
answered on 25 Jan 2010, 03:09 PM
HI

 I am not  able  to solve this issue.

if select the TreeNode it should select only  the content no need to extent the selection , because if it is  add multi child nodes tree node selection is big . also each node item i gave color , so the node color also increase , i hope so i gave screen shot in  above post.
pls give the solution as early as possible.

0
Kiril Stanoev
Telerik team
answered on 28 Jan 2010, 09:19 AM
Hi Murugan,

Please find attached a sample project containing the edited ControlTemplate of RadTreeViewItem, where the HorizontalAlignment of the header element is set to Left. Let me know how this works for you.

Kind regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
yjh
Top achievements
Rank 1
answered on 01 Jul 2010, 11:07 AM
When using data binding and HierarchicalDataTemplate, how to do it?

RadTreeView had better provide a property or itemstyle to limit the item width.
0
Kiril Stanoev
Telerik team
answered on 06 Jul 2010, 03:30 PM
Hello Yjh,

You can use RadTreeView's ItemContainerStyle property. Please see the attached project for further reference.

On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

Greetings,
Kiril Stanoev
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
yjh
Top achievements
Rank 1
answered on 15 Jul 2010, 02:53 AM
Thanks Kiril Stanoev and your team.
Tags
TreeView
Asked by
smith
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Miroslav
Telerik team
smith
Top achievements
Rank 1
Ivan
Telerik team
Kiril Stanoev
Telerik team
yjh
Top achievements
Rank 1
Share this question
or