Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
410
XamDataGrid and grouping
posted

Hello,

I have a XamDataGrid showing data with 1-level grouping. I would like to show some white space between each group (the white space is below the last row in each group). Is it possible to achieve this?

Thank you!

  • 17475
    Verified Answer
    Offline posted

    Hello Jack, 

    Thank you for posting! 

    White space could be added below each group by setting a style for GroupByRecordPresenter and changing the margin property so that more space is left blank above each group record. In order to remove the space above the top most record a trigger could be added. It checks if the record index is zero and set the margin to “0,0,0,0”:

    <Style TargetType="{x:Type ig:GroupByRecordPresenter}">

                        <Setter Property="Margin" Value="0,50,0,0"/>

                        <Style.Triggers>

                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.Index}" Value="0">                           

                                <Setter Property="Margin" Value="0,0,0,0"/>

                            </DataTrigger>                       

                        </Style.Triggers>                  

                    </Style>      

    Please feel free to let me know if this helps you.