We are using MVVM pattern for our application. We have used xamDataGrid and binded its DataSource and ActiveDataItem to viewmodel class property.
DataSource="{Binding Path=FilterList}" ActiveDataItem="{Binding Path=SelectedFilter}"
When we add new item in "FilterList" collection and set newly created item as "SelectedFilter", record get added in xamDataGrid. However focus remain on newly added row and I am not able to move focus on cell for editing it values (using F2 key).
Please note we want to do this without using mouse.. So using CellClickAction="EnterEditModeIfAllowed" does not come in picture as we are navigating through keyboard.
Hi,
I hadn’t heard back from you. I was wondering if you had further questions.
If so, please feel free to contact me.
Here is my sample that demonstrates using the PreviewKeyDown event and identifying the F2 key, then setting the first cell of the currently active row as the ActiveCell.
Then the F2 key will function as expected causing the ActiveCell to go into Edit mode.
The button in the sample arbitrarily sets a row as the active row in the underlying data and then set the focus to the xamDataGrid so that F2 will again cause the first cell in that row to go into edit mode.
Let me also point out these documents that may be helpful.
Keyboard Navigation
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=xamDataPresenter_Keyboard_Navigation_in_xamDataPresenter.html
Selection Type
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=InfragisticsWPF4.v11.1~Infragistics.Windows.Controls.SelectionType.html
Changing Selection Behavior
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=xamData_Changing_Field_Record_Cell_Selection_Behavior.html
Let me know if you have any questions.