2011-09-07 5 views

答えて

32

あなたはMyBackgroundBrushある場合、これは動作しますDataGrid

<DataGrid ...> 
    <DataGrid.RowStyle> 
     <Style TargetType="DataGridRow"> 
      <Setter Property="Background" Value="{Binding MyBackground}"/> 
     </Style> 
    </DataGrid.RowStyle> 
    <!-- ... --> 
</DataGrid> 

ためRowStyleBackgroundをバインドすることができます。あなたは、このような場合には、あなたが私はそれをチェックします代わりに

<Setter Property="Background"> 
    <Setter.Value> 
     <SolidColorBrush Color="{Binding MyColor}"/> 
    </Setter.Value> 
</Setter> 
+0

おかげでこれを使用することができ、Colorを持っているあなたの質問に言及します – david