Как добавить в конвертер ItemSource в SfDataGrid?
У меня есть SfDataGrid с привязкой ItemSource = "{Binding Items}"
Необходимо создать конвертер для изменения фона ячеек используя MultiBinding
Данный код работает для обычного DataGrid, а здесь в первом элементе выводит DependencyProperty.UnsetValue. В чем можем быть проблема?
<Style TargetType="Syncfusion:GridCell">
<Setter Property="Background">
<Setter.Value>
<MultiBinding Converter="{StaticResource myValidConverter}">
<Binding Path="ItemSource" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type Syncfusion:SfDataGrid}}"/>
<Binding RelativeSource="{RelativeSource Self}"/>
<Binding/>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
public class MaxConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.White);
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
Список, который присваивается в ItemSource выглядит так
public ObservableCollection<DisplayRobot> Items
{
get { return _items; }
set { _items = value; }
}