C# – Stop Datagrid selecting first row by default

cdatagridwpf

I am using Wpf Toolkit DataGrid. Whenever I assign Itemssource to it, its first item get selected and its selectionChanged event gets called. How can I stop it to select any row by default?

Best Answer

Check if you have set IsSynchronizedWithCurrentItem="True" and you require it to be set alike?

<DataGrid IsSynchronizedWithCurrentItem="True" ... 
            
            

With set this property to true, the selection of the first item is the default-behaviour.