Edit this page

First Row is Always Selected

PROBLEM

By default, the first row of the GridView is selected. This is also causing the SelectionChanged event to fire when the grid is loaded.

This behavior does not occur in Q2 2010 version and later.

CAUSE

Let's first start with some definitions:

  • SelectedItem - this is the data item (business object) of the selected row.

  • CurrentItem - holds the data item (business object) of the row which currently holds the focus. It may or may not coincide with the selected row.

With versions prior to Q2 2010, the current item was synchronized with the selected item by default. As a result, the first row of the GridView was initially selected.

SOLUTION

Set the IsSynchronizedWithCurrentItem property of RadGridView to False.

Since Q2 2010 version the IsSynchronizedWithCurrentItem is null by default - SelectedItem is synchronized with the CurrentItem only if CollectionView is used as ItemsSource.