DataGrid ItemsSource

Apr 24, 2009 at 8:28 PM
The first time the ItemsSource property is set, everything seems to work as expected.
If I change the ItemsSource everything is still ok if I'm working with 5000 items or so.

The problem appears only if I have a small collection of items.
If I'm using a collection of 5 items or so, when the ItemsSource is set for the first time, all is ok.
If I change the ItemsSource, the first item is not visible.  It seems to be hidden behind the ColumnHeaders.
If I select an item it gets highlighted.
Pressing the up arrow key will highlight the item directly above.
Pressing the up arrow key when the first visible row is highlighted will cause the highlighting to disappear.
If I click on a ColumnHeader, the missing row will reappear.

I hope there is an easy fix for this because I cannot use the DataGrid the way it is working.