tags:

views:

314

answers:

0

Hi everybody!

I 'm going mad!!

Created a "MainVM" (VM stands for ViewModel) in which there is defined a SelectedItem of type "EditVM". There is also another property (let's call it) excavations (this is an app for archaeologists) and its corresponding excavationsCollectionView (hope the type is clear, to not get into details).

This excavationsCollectionView is bound to a datagrid which shows retrieved values perfectly! I have bound the currentItem of this Datagrid to the aforementioned SelectedItem!

So the user can "switch" views and see the details of the SelectedItem.

Now comes the "messy" part! Every textfield on this view shows its values correctly, BUT!!the comboboxes behave weird! If the user moves to the next record using

excavationsCollectionView.MoveCurrentToNext()

the comboboxes in the next record show up correctly! Moving BACK shows a (random??) value (i cannot figure out which value it is). And of course moving again forth makes the comboboxes content show again mysterious values (from previous records, but i cannot determine from which).

First i thought it is an issue regarding binding to the SelectedItem of the Datagrid (which is not, because deleting this column out of the grid didn't change the situation).

So i'm stuck here and don't know how to operate on this!!!

EDIT: After the third line (using final value 'City1') occurs the break in the binding! It seems the data is pre-fetched and used to update the existing (and still current???) values! This shouldn't be there!!

System.Windows.Data Warning: 76 : BindingExpression (hash=50160154): TransferValue - got raw value 'City1'

System.Windows.Data Warning: 80 : BindingExpression (hash=50160154): TransferValue - implicit converter produced 'City1'

System.Windows.Data Warning: 85 : BindingExpression (hash=50160154): TransferValue - using final value 'City1'

System.Windows.Data Warning: 50 : Using CollectionView directly is not fully supported. The basic features work, although with some inefficiencies, but advanced features may encounter known bugs. Consider using a derived class to avoid these problems.

System.Windows.Data Warning: 86 : BindingExpression (hash=50160154): Update - got raw value 'City2'

System.Windows.Data Warning: 89 : BindingExpression (hash=50160154): Update - implicit converter produced 'City2'

System.Windows.Data Warning: 90 : BindingExpression (hash=50160154): Update - using final value 'City2'

System.Windows.Data Warning: 98 : BindingExpression (hash=50160154): SetValue at level 1 to Excavation (hash=12289189) using RuntimePropertyInfo(Prefecture): 'City2'

System.Windows.Data Warning: 91 : BindingExpression (hash=50160154): Got PropertyChanged event from Excavation (hash=12289189)

System.Windows.Data Warning: 92 : BindingExpression (hash=50160154): Got PropertyChanged event from ComboBox (hash=42614420) for DataContext

System.Windows.Data Warning: 75 : BindingExpression (hash=50160154): Deactivate

System.Windows.Data Warning: 99 : BindingExpression (hash=50160154): Replace item at level 0 with {NullDataItem}

System.Windows.Data Warning: 99 : BindingExpression (hash=50160154): Replace item at level 1 with {NullDataItem} System.Windows.Data Warning: 74 : BindingExpression (hash=50160154): Activate with root item EditViewModel (hash=13409334)

System.Windows.Data Warning: 103 : BindingExpression (hash=50160154): At level 0 using cached accessor for EditViewModel.excavation: RuntimePropertyInfo(excavation)

System.Windows.Data Warning: 100 : BindingExpression (hash=50160154): Replace item at level 0 with EditViewModel (hash=13409334), using accessor RuntimePropertyInfo(excavation)

System.Windows.Data Warning: 97 : BindingExpression (hash=50160154): GetValue at level 0 from EditViewModel (hash=13409334) using RuntimePropertyInfo(excavation): Excavation (hash=273093)

System.Windows.Data Warning: 103 : BindingExpression (hash=50160154): At level 1 using cached accessor for Excavation.Prefecture: RuntimePropertyInfo(Prefecture)

System.Windows.Data Warning: 100 : BindingExpression (hash=50160154): Replace item at level 1 with Excavation (hash=273093), using accessor RuntimePropertyInfo(Prefecture)

System.Windows.Data Warning: 97 : BindingExpression (hash=50160154): GetValue at level 1 from Excavation (hash=273093) using RuntimePropertyInfo(Prefecture): 'City2'

System.Windows.Data Warning: 76 : BindingExpression (hash=50160154): TransferValue - got raw value 'City2'

System.Windows.Data Warning: 80 : BindingExpression (hash=50160154): TransferValue - implicit converter produced 'City2'

System.Windows.Data Warning: 85 : BindingExpression (hash=50160154): TransferValue - using final value 'City2'

System.Windows.Data Warning: 50 : Using CollectionView directly is not fully supported.
The basic features work, although with some inefficiencies, but advanced features may encounter known bugs. Consider using a derived class to avoid these problems.

System.Windows.Data Warning: 92 : BindingExpression (hash=50160154): Got PropertyChanged event from ComboBox (hash=42614420) for DataContext

System.Windows.Data Warning: 75 : BindingExpression (hash=50160154): Deactivate

System.Windows.Data Warning: 99 : BindingExpression (hash=50160154): Replace item at level 0 with {NullDataItem}

System.Windows.Data Warning: 99 : BindingExpression (hash=50160154): Replace item at level 1 with {NullDataItem}

System.Windows.Data Warning: 74 : BindingExpression (hash=50160154): Activate with root item EditViewModel (hash=17173514)

System.Windows.Data Warning: 103 : BindingExpression (hash=50160154): At level 0 using cached accessor for EditViewModel.excavation: RuntimePropertyInfo(excavation)

System.Windows.Data Warning: 100 : BindingExpression (hash=50160154): Replace item at level 0 with EditViewModel (hash=17173514), using accessor RuntimePropertyInfo(excavation)

System.Windows.Data Warning: 97 : BindingExpression (hash=50160154): GetValue at level 0 from EditViewModel (hash=17173514) using RuntimePropertyInfo(excavation): Excavation (hash=62641008)

System.Windows.Data Warning: 103 : BindingExpression (hash=50160154): At level 1 using cached accessor for Excavation.Prefecture: RuntimePropertyInfo(Prefecture)

System.Windows.Data Warning: 100 : BindingExpression (hash=50160154): Replace item at level 1 with Excavation (hash=62641008), using accessor RuntimePropertyInfo(Prefecture)

System.Windows.Data Warning: 97 : BindingExpression (hash=50160154): GetValue at level 1 from Excavation (hash=62641008) using RuntimePropertyInfo(Prefecture): 'City2'

System.Windows.Data Warning: 76 : BindingExpression (hash=50160154): TransferValue - got raw value 'City2'

System.Windows.Data Warning: 80 : BindingExpression (hash=50160154): TransferValue - implicit converter produced 'City2'

System.Windows.Data Warning: 85 : BindingExpression (hash=50160154): TransferValue - using final value 'City2'

......

Any help greatly appreciated!