Anyway to avoid selecting the first row when loading?

Oct 8, 2008 at 3:30 PM
When I load up my datagrid, it is bound CollectionViewSource, and I have an Event handler for OnSelectionChanged, however, I do not want the grid to automatically select the first row for me by default (this firing the event when loading).  Is there anyway to avoid this behavior and not have a row selected?

Thanks,
Bob
Coordinator
Oct 8, 2008 at 3:59 PM
This is probably happening b/c IsSynchronizedWithCurrentItem is set to true.  You can set that to false.  If you still want it to be synchronized however, you can have your OnSelectionChanged logic work only after the DataGrid is loaded.