2016-07-29 105 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很多,像一個魅力:) –