views:

75

answers:

2

Hello, This is my Listview XAML code:

<ListView ItemsSource="{Binding Items}" Margin="0" Grid.Row="1" >
            <ListView.View>
                <GridView>
               <GridViewColumn
                    Header="OperatorId"
                    DisplayMemberBinding="{Binding OperatorId}"  x:Name="operatorIdColumn"/>
                <GridViewColumn
                    Header="OperatorValue" x:Name="operatorValueColumn"
                    DisplayMemberBinding="{Binding Row.OperatorRow.Value}"  /> 
            </GridView>
            </ListView.View>
        </ListView>

How can I make the operatorValueColumn update itself when operatorIdColumn's value changes?. In other words how can I do that when OperatorId changes? INotifyPropertyChanged has been implemented in the object ListView is bound to.

Edit: The List view is bound to a TypedDataSet's DataTable. The "Row.OperatorRow.Value" basically hooks to the parent table (Operators) to get the actual value. When I try changing the OperatorId, operatorIdColumn updates displaying the new Id but operatorValueColumn does not update itself to the new operator value.

If I can force a binding update on operatorValueColumn based on operatorId change, I will get the new value. This might be a hack, still I want to know how to do this if possible.

This is for a Test Usercontrol which will be used to cross check local datastructure values quickly. So patterns aren't important.

A: 

SKG, try binding to a Method passing in an OperatorId that spits out the corresponding Row.OperatorRow.Value for that OperatorID...

Gustavo Cavalcanti
A: 

simple solution is to use multi binding and bind yourself to both columns.. on the multi converter always return the one you wanna present.

Chen Kinnrot