Hi. I have a very simple for with 2 grids:
I bound both grids to the same ListViewCollection:
When I select a row on one of the grid, the matching row gets selected on the 2nd grid. Why is this happening? This behavior does not happen when setting ItemsSource property to the underlying collection, only when using ListViewCollection. This is a very simple example that shows the basic issue I am trying to figure out in a much larger application where using underlying collection is not possible. If anyone knows why this is happening I would love to understand (and hopefully fix).
You can download the project showing a problem here WpfApplication1
Thanks
<
Grid
Margin
=
"0,165,0,0"
>
<
telerik:RadGridView
Margin
=
"0,-155,0,307"
x:Name
=
"Grid1"
/>
<
telerik:RadGridView
Height
=
"293"
VerticalAlignment
=
"Bottom"
x:Name
=
"Grid2"
/>
</
Grid
>
I bound both grids to the same ListViewCollection:
private readonly ObservableCollection<
Tuple
<string, string>> _data = new ObservableCollection<
Tuple
<string, string>>();
private ListCollectionView _dataView;
....
this.Loaded += (sender, args) =>
{
for (int i = 0; i < 10; i++)
{
_data.Add(Tuple.Create("row" + i, "value" + i));
}
_dataView = new ListCollectionView(_data);
Grid1.ItemsSource = _dataView;
Grid2.ItemsSource = _dataView;
};
When I select a row on one of the grid, the matching row gets selected on the 2nd grid. Why is this happening? This behavior does not happen when setting ItemsSource property to the underlying collection, only when using ListViewCollection. This is a very simple example that shows the basic issue I am trying to figure out in a much larger application where using underlying collection is not possible. If anyone knows why this is happening I would love to understand (and hopefully fix).
You can download the project showing a problem here WpfApplication1
Thanks