Hierarchical Padding / Margin

3 posts, 0 answers
  1. Dan Andrews
    Dan Andrews avatar
    28 posts
    Member since:
    Jul 2009

    Posted 02 Nov 2010 Link to this post

    How do we move the Hierarchical grid view up so that when it is expanded there is no padding or margin around it (I'm not sure if the space belongs to parent (padding) or child (margin))?  See attached

    Secondly, how do we align the columns?  This works, but it's a bit of a hack:
    <t:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
            <t:RadGridView  ItemsSource="{Binding children}"
                            Margin="18,0,-8,0"
                            HorizontalAlignment="Stretch"
                            x:Name="childGridView"
                            Style="{StaticResource ChildRadGridViewStyle}"
                            AutoGenerateColumns="False" 
                            CanUserFreezeColumns="False"
                            Width="{Binding ElementName=childGridView, Path=ActualWidth,Mode=TwoWay}">

  2. Dan Andrews
    Dan Andrews avatar
    28 posts
    Member since:
    Jul 2009

    Posted 03 Nov 2010 Link to this post

    Is there an example in the Code Base that I didn't see?
  3. DevCraft banner
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 05 Nov 2010 Link to this post

    Hi Dan,


    Generally the recommended approach is to edit the template of GridViewRow. You can find in its template the part HierarchyChildPresenter and resets its Padding property, by default this property is set to 6.

    Attached is an example that demonstrates this technique.
     
    Kind regards,
    Vanya Pavlova
    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
Back to Top