I have a table with different columns I am showing two in this code :
<DataGridTextColumn Header="Allocated" Binding="{Binding Allocated}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background">
<Setter.Value>
<MultiBinding Converter="{StaticResource converter}">
<Binding Path="Current_Phase" />
<Binding Path="Status" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Op10}" Header="WIP OP10" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background">
<Setter.Value>
<MultiBinding Converter="{StaticResource converter}">
<Binding Path="Current_Phase" />
<Binding Path="Status" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
The problem I have My IConverterClass is returning a background colour and is putting green for both, but my current phase is "op30"(my parameters value) but still is changing the colour of column op10. I am totally lost, pls helppppp.
My converter Class
object IMultiValueConverter.Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string type = values[0].ToString();
string status = values[1].ToString();
if (type == "op10" && status == "10")
{
return Brushes.Green;
}
else if ( type == "op30" && status == "30")
{
return Brushes.Green;
}
else
{
return DependencyProperty.UnsetValue;
}
}
Please Helppp, I dont know what to do.