We are experiencing a similar issue to what have been described here:
WPF Datagrid default selected 0th row after setting Datasource
We have our WPF GridControl bound to the following public property:
public IList<IndexRow> IndexRows
indexRows = value;
This property is being set on a 5 minutes interval. However, whenever this property is being set the GridControl resets it's selected row back to the first row.
Is there any resolution to this?
The sample is attached.
It is not the whole project though, just the relevant pieces.
The Grid is defined inside VolumeProfileDialog.xaml and the bound data is in VolumeProfileModel.cs
We have examined this problem. This behavior is by design, since it is not possible to maintain a FocusedRow if you re-assign the GridControl.DataSource.
If objects in your collection are not recreated on update, you can bind the TableView.FocusedRow property to corresponding object in your ViewModel (by using TwoWay binding) and in this task the FocuserRow should be maintained.
Otherwise, you need to restore the FocusedRow manually.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.