Edit this page

First Row is Always Selected

PROBLEM

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

This behavior does not occur in versions after Q2 2010.

CAUSE

Let's first start with some definitions:

  • SelectedItem: Holds the data item (business object) of the selected row.

  • CurrentItem: Corresponds to the CurrentItem of the bound ICollectionView. 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 control 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 a CollectionView is used as ItemsSource.

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy