Hello,
I took the default style for CellValuePresenter from DataPresenterGeneric_Express.xaml and am modifying it. Among other things, I'm setting the background color of a cell by using a value converter:
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Background" Value="{Binding Path=Value, Converter={StaticResource cellColorFromDetectionDataTypeConverter}, RelativeSource={RelativeSource Self}}"/>
I would now like to use the "parameter" parameter to the value converter. Specifically, I'd like to pass the row number to the converter. How may I alter my xaml to do so?
Thanks,
Dave
Hello Dave,
You can use a IMultiValueConverter instead of IValueConverter and you can pass both the value and the record index.
You can see an example of a similar approach here.
I'll elaborate and make a general statement of what I'm trying to do: I want to set a cell's background color based on its content, row number, and column number. My original post is an obvious attempt to do that, and I'd still like to go that route if possible. However, I would also be glad to hear suggestions other than using a value converter to achieve my goal.