2016-07-29 276 views
1

如何将透明背景设置为DataGrid如何为DataGrid设置透明背景?

下不工作:

<DataGrid Background="Transparent" > 
    <DataGrid.CellStyle> 
     <Style TargetType="DataGridCell"> 
      <Setter Property="Background" Value="Transparent"/> 
     </Style> 
    </DataGrid.CellStyle> 
</DataGrid> 

它保持洁白如雪,此代码:)

编辑:

更新的代码(复制粘贴问题)

+0

这不是你正在使用的代码(看第一行中的'false') –

回答

3

您需要将RowBackground也设置为Transparent

<DataGrid Background="Transparent" RowBackground="Transparent"> 
+0

Thx很多,像一个魅力:) –