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

Remove Space in RadTreeViewItem

4 Answers 87 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 21 Oct 2011, 09:21 AM
Hello,

i am rather new to the RadTreeView, so forgive me if this is a dumb question:

I could not figure how to get rid of the space between the expander icon and the Header Content or DefaultImage of a TreeItem. It seems to me as if this is the "reserved space" for the optional checkbox item.
I attached an image as i am not sure if it becomes obvious without that ;)

Do you have any advice how to remove that unused space?

Thanks in advance
S. Witt

4 Answers, 1 is accepted

Sort by
0
Sebastian
Top achievements
Rank 1
answered on 24 Oct 2011, 11:35 AM
really, no one?

can it probably be done by a custom HeaderTemplate? But how would i apply that?  the space still stays although if i do not use the header property of the RadTreeViewItem for the content.

edit : using an hierarchical datatemplate populated by a class with several levels that comes from a wcf service:
        <telerik:HierarchicalDataTemplate x:Key="level1"<br>            ItemsSource="{Binding level2}"<br>            ItemTemplate="{StaticResource level2}"><br>            <telerik:RadTreeViewItem <br>                Click="RadTreeViewItem_Click"<br>                DefaultImageSrc="{Binding Converter={StaticResource RelaConverter}}"<br>                Header="{Binding name}"><br>            </telerik:RadTreeViewItem><br>        </telerik:HierarchicalDataTemplate>
0
Petar Mladenov
Telerik team
answered on 26 Oct 2011, 09:14 AM
Hi Sebastian,

 I found your snapshot very strange. It seems like the DefaultImageSrc property of the RadTreeViewItem is used and a blank / transparent image is used. This problem cannot be caused by the CheckBox element from the Template of the RadTreeViewItem, when it is not used, there is no reserved space. You can examine this is the attached project. The first RadTreeViewItem has Image and Checkbox, the second has only Image, the third has only Checkbox and the fourth has no image and no checkbox.
Is it possible for you to send us your XAML or a runnable sample showing how this RadTreeViewItem is produced? This will be highly appreciated and we would be better able to assist you. Thank you in advance.

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Sebastian
Top achievements
Rank 1
answered on 26 Oct 2011, 07:30 PM
Hi Petar, thanks for the answer.

It has nothing to do with the DefaultImgSrc, if an image was set the "gap" was still the same with the image showing where the header text begins in my example image.

I finally managed to get it done (at least for this solution) by extracting the RadTreeViewItem style and setting the Width of "EditHeaderElement" to zero (maybe auto would also work).
Could that be caused by some (missing) setting or property and i just overlooked that?

I will try if the behaviour is the same in a standalone demo and send it to you If you are interested.
0
Petar Mladenov
Telerik team
answered on 31 Oct 2011, 05:57 PM
Hi Sebastian,

 Yes we are very interested in investigating this strange behaviour. We are looking forward to your sample. Thank you for your cooperation in advance.

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Sebastian
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or