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
245
Spacing between 2 rows
posted

I want to to add some blank space in between 2 rows of xamdatagrid grid.  Can you please suggest how can I achieve this? 

Parents
  • 6365
    Offline posted

    Hello Richa,

    You can add space between two records by simply increasing the bottom (or top) margin of one of the records. It would really depend on the exact functionality you are looking for and under what conditions (if any) this visual change should be triggered.

    For example:

    Approach (1) Space between every 2 records.

    <Style TargetType="igDP:DataRecordPresenter">
        <Setter Property="Margin" Value="0,0,0,10" />
    </Style>

    Approach (2) Space between a specific record and the one beneath it.
    This will create a blank space between the record whose DataItem.Name property is "Item 7" and the record beneath it.

    <Style TargetType="igDP:DataRecordPresenter">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=Record.DataItem.Name, RelativeSource={RelativeSource Self}}"
                            Value="Item 7">
                <Setter Property="Margin" Value="0,0,0,10" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    I have attached a sample application that demonstrates the approaches from above.

    If you have any questions, please let me know.

    XamDataGrid_sample.zip
Reply Children