I'm using DataGrid to show data through data binding. My data are provided in a list.
The setup I have is the following:
DataGrid "binded" to the default view of my list that implement IList<T> and IList interfaces
(MyList<T> : IList<T>, IList, INotifyCollectionChanged)
// Set the data context
DataContext = view;
T: is here my 'business object' that hold the data, called 'MyRow'.
Then the columns of the DataGrid are bound to public properties of 'MyRow' object.
MyRow class has a public property of type 'object' (public object data[int index]) and
first column of datagrid is bound to myRow.data, second column is bound to myRow.data and so on.
When the datagrid is displayed, databinding kick in and my data are showed in the control.
The issue I'm having is that data fetching is very repetitive even for the same rows. For example for a datagrid with 20 visible rows, the first row is fetched multiple times even if the datagrid is not resized or moved. I put break point inside my list
(MyList<T> into This[T] property (public T this[int index]) and i got multiple hits into the property for the same index.
View Complete Post