2011-09-07 14 views

Respuesta

32

puede enlazar las Background en el RowStyle para DataGrid

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

Esto funciona si MyBackground es una Brush. Usted menciona en su pregunta que usted tiene una Color, si este es el caso, puede utilizar esta vez

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

gracias Lo comprobaré – david

Cuestiones relacionadas