How to use the IsSelected property of the row in a converter?

248 views Asked by At

I have a datagrid and I am using this multivalue converter:

<DataGrid.RowStyle>
    <Style TargetType="DataGridRow">

        <Setter Property="Background">
            <Setter.Value>
                <MultiBinding Converter="{StaticResource ucComponentesDataGridComponentesBackgroundFilaMultiValueConverter}">
                    <MultiBinding.Bindings>
                        <Binding />
                        <Binding Path="IsSelected"/>
                    </MultiBinding.Bindings>
                </MultiBinding>
            </Setter.Value>
        </Setter>

But in this way I can´t get the IsSelected property of the row. How can I use the property in my multi value converter?

1

There are 1 answers

0
Álvaro García On BEST ANSWER

Well, the solution is replace this line:

<Binding Path="IsSelected"/>

for this one:

<Binding RelativeSource="{RelativeSource Self}" Path="IsSelected"/>