This is a new issue pertaining to other related issues raised:
If I have an IMultiValueConverter assigned to a MultiBinding on a DataCell Style.Setter, with a Binding to the DataCell itself and/or its Content property and another Binding to its DataContext property, if the converter is then invoked by changing the AutoFilterValues on one of the columns in the grid, after several calls to the converter, the bindings become out of sync and start pointing to completely different objects when they should in fact always be related to the same DataCell.
I've attached an example project demonstrating this error. To reproduce it, follow these steps:
1. Run the application in the debugger.
2. Once the grid and all its value have been displayed, put the following entries in the Watch window:
((System.Data.DataRowView)(((System.Windows.FrameworkElement)(cell)).DataContext)).Row.ItemArray
row.ItemArray
3. Put a breakpoint at line 72 of Page1.xaml.cs:
if (!content.Equals(row.Table.Rows[currentRowIndex-1][cell.FieldName]))
4. Select one of the AutoFilter values from any column (e.g., 'MyProp1' column)
5. At the breakpoint, expand the arrays for the two entries in the Watch window. They should be identical.
6. Press F5 to cycle through each DataCell stopping at the breakpoint for each DataCell and keep an eye on the values of the two arrays in the Watch window.
Keep cycling through and you will notice after several iterations, the values in the arrays become out of sync. They are no longer identical. This is not supposed to happen because they represent the DataContext via the binding to the DataCell and the DataContext via the binding to the DataCell.DataContext property directly of the same DataCell as the first binding.
This seems to be a bug and it means I cannot use your MultiBinding solution for a grid where I need to use filtering. Please could you look into this?
Thanks,
Jason
Associate, .NET Development
Morgan Stanley, UK