Question

i have a problem: I have a datagrid. The DataContext of the grid is set to a collection called 'FinanceTransferEntries' which has a couple of fields. The code segment below shows the first column that is bound the the property 'ID' of the collection (which works fine).

I implemented a converter that colors the background of the cell depending on

  1. a static boolen value "IDTransfer" --> works fine too
  2. and the value of the current cell of the field.

Here is my problem. I didn't figure out the correct binding statement to access the current value of the 'ID' property.

    <igDP:Field Name="ID" Label="ID" Width="Auto"  >
        <igDP:Field.Settings>
            <igDP:FieldSettings AllowEdit="False">
                <igDP:FieldSettings.EditorStyle>
                    <Style TargetType="{x:Type igEditors:XamTextEditor}" >
                        <Setter Property="Background">
                            <Setter.Value>
                                <MultiBinding Converter="{StaticResource DependentBackrgoundConverter}">
                                    <Binding ? />
                                    <Binding RelativeSource="{RelativeSource AncestorType={x:Type uc:TransferDataUC}}" Path="ViewModel.SelectedFinanceTransferViewModel.FinanceTransferDetailViewModel.IDTransfer" />
                                </MultiBinding>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </igDP:FieldSettings.EditorStyle>
            </igDP:FieldSettings>
        </igDP:Field.Settings>
    </igDP:Field>

Help would be appreciated!

Was it helpful?

Solution

Thank you Clemens, the expression

<Binding Path="DataItem.ID"/>

did it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top