Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
Accessing a Row Number From Within a CellValuePresenter Style
posted

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

 

Parents
No Data
Reply
  • 69686
    posted

    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.

Children
No Data