1
votes

I use XPF.Grid.GridControl, bind to IEnumerable data gridControl.DataSource = dataSource;

I need highlight row depend on cell value. Cell contains color name. Ok I use:

   <dxg:GridControl.Resources>
          <Style x:Key="ColorRowStyle" TargetType="{x:Type dxg:GridRowContent}">
                                <Setter Property="Background" Value="{Binding Converter={l:IntoToColorConverter}}" />
          </Style>
   </dxg:GridControl.Resources>

At my IntoToColorConverter I need access data binding to row, but at public object Convert(object value, System.Type targetType,object parameter, System.Globalization.CultureInfo culture) I have

       value is RowData
       value.DataContext - RowTypeDescriptor

How should I access row data with this objects?

1

1 Answers

0
votes

You could try defining a generic style for the cells in Datagrid.Resources such as

<Style TargetType="{x:Type DataGridCell}">
    <Setter Property="Background" Value="{Binding RowColor, Converter={MyColorConverter}}" />    
</Style>