0
我在我的DataGridTemplateColumn中有一個StackPanel。我似乎無法找到一種方法來刪除此單元格頂部的邊距。DataGridTemplateColumn頂部邊距/填充
下面是我使用的代碼:
<DataGridTemplateColumn IsReadOnly="True" Header="Description">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type Label}">
<Setter Property="FrameworkElement.Margin" Value="0,0,0,-10" />
</Style>
</StackPanel.Resources>
<Label Content="{Binding Description1}" />
<Label Content="{Binding Description2}" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
的利潤率似乎從DataGridTemplateColumn本身而不是StackPanel的,因爲只有第一個標籤都有它上面的間距。