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
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
>
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.
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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.
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 >>