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
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.
<Setter Property="Margin" Value="1,1,1,1" />
</Style>
I hope this helps
Thanks Joe,
I added the style definitions that you posted, but it did not have any effect. I am not using the editors directly, are they automatically used? Here is the XAML for my grid:
<igDP:XamDataPresenter x:Name="currentAllocDSPPresenter" DataSource="{Binding Source={StaticResource ResourceAllocDspDS}}" AutoFit="False" HorizontalAlignment="Left" GroupByAreaLocation="None" Theme="Aero" >
<igDP:XamDataPresenter.FieldSettings>
<igDP:FieldSettings AllowEdit="False" AllowResize="False" CellContentAlignment="ValueOnly" CellClickAction="SelectRecord"/>
</igDP:XamDataPresenter.FieldSettings>
<igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" DataRecordCellAreaStyle="{StaticResource readOnlyCellAreaStyle}" RecordSelectorLocation="None" HighlightAlternateRecords="True" />
</igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:XamDataPresenter.FieldLayouts>
<igDP:FieldLayout Key="fieldLayout">
<igDP:FieldLayout.Fields>
<igDP:Field Name="DeviceName">
<igDP:Field.Settings>
<igDP:FieldSettings CellWidth="80" CellMaxHeight="20" />
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="G711">
<igDP:FieldSettings CellWidth="60" CellMaxHeight="20"/>
... other fields just like the ones above ...
</igDP:FieldLayout>
</igDP:XamDataPresenter.FieldLayouts>
</igDP:XamDataPresenter>