Remove Space in RadTreeViewItem

5 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    7 posts
    Member since:
    Mar 2011

    Posted 21 Oct 2011 Link to this post

    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
  2. Sebastian
    Sebastian avatar
    7 posts
    Member since:
    Mar 2011

    Posted 24 Oct 2011 Link to this post

    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>
  3. DevCraft banner
  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Oct 2011 Link to this post

    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 >>

  5. Sebastian
    Sebastian avatar
    7 posts
    Member since:
    Mar 2011

    Posted 26 Oct 2011 Link to this post

    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.
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 31 Oct 2011 Link to this post

    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 >>

Back to Top
DevCraft banner