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
329
How to change the spacing between rows
posted

I have a case where I need the rows of the grid to be smaller than the default height.  When I set the cell max height to something like 20, there is plenty of space to show the text, but the bottom of the text gets cut off and there is empty space above the text (see image).

 

I have tried creating a CellValuePresenter and setting the margin and padding to 0, but that did not work.  Is there a way to modify the spacing between rows?

 John Myczek

  • 4850
    Verified Answer
    Offline posted

    Hi John,

    The propblem was caused by the default styles for the editors having overly large margin and padding properties. We have since corrected this. In the build you have you can control this by specifying these settings for the editors. The easiest way to do this is to provide styles in the resources collection. e.g.

    <Style TargetType="{x:Type igEditors:XamTextEditor}">

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

    <Setter Property="Padding" Value="1,1,1,1" />

    </Style>

    <Style TargetType="{x:Type igEditors:XamDateTimeEditor}">

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

    <Setter Property="Padding" Value="1,1,1,1" />

    </Style>

    <Style TargetType="{x:Type igEditors:XamNumericEditor}">

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

    <Setter Property="Padding" Value="1,1,1,1" />

    </Style>

    <Style TargetType="{x:Type igEditors:XamCurrencyEditor}">

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

    <Setter Property="Padding" Value="1,1,1,1" />

    </Style>

    I hope this helps