Hi,
I am using a XamDataGrid with Virtualization enabled. When a cell is in edit mode and I press enter I need the cell of next row to be in edit mode.
This works fine for the records in view but when I movie to invisible records then I am able to navigate to them and select them but the cell is still not coming to edit mode.
Also for few cells the edit mode gets enabled while for most of them it still remains deactivated.
I have tried certain things like BringRecordIntoView, RecordNext but no luck.
Please help.
Hello Neelesh,
Thank you for your post!
I have been looking into it and it seems that I am missing something from your scenario. I have created a small sample application in order to test the functionality you have reported.
In the sample application I have a simple XamDataGrid, bound to a collection. I also have a button, that scrolls a record, that is not in view when the application starts, then makes the first cell of that record active and makes it to enter in edit mode.
Please note, that if you are using the StartEditMode command of the DataPresenterCommands - it places the cell, that is currently active in edit mode.
Would you please provide me with more detailed information about the scenario you want to achieve? Also if possible would you please modify the sample application with the functionality you are using, so it reproduces the issue?
Looking forward to hearing from you.
Hi Gergana,
I will try to clarify my query. I have a Xamdatagrid which is bound to some data source. When I double click on a cell it gets into edit mode as expected. Now with this cell in edit mode I press enter. What I want is when I press the enter button, the focus should move to next row and it's third field must get into edit mode.
For now when the Window loads there are 10 visible rows, when I edit the first row's field and press enter then the cell of next row gets into edit mode and this happens for all the rows in view. But when I press enter on the 10th row then the 11th row which is not visible doesn't enter the edit mode.
In the code you shared I have handled the PreviewKeyDown event and wrote following code
private void OnPreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { igDataGrid.ExecuteCommand(DataPresenterCommands.RecordNext); igDataGrid.ActiveCell = (igDataGrid.ActiveRecord as DataRecord).Cells[0]; igDataGrid.ExecuteCommand(DataPresenterCommands.StartEditMode); } }
In this scenario even the next visible row in not entering the edit mode.
P.S. Virtualization is needed and enabled in the code.
I am using Infragistics version 12.2