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
I have been looking into your issue.
The "Enter" key is preserved for the following command " EndEditModeAndCommitRecord". What I can suggest is to handle the ExecutingCommand event of the XamDataGrid and check if the name of the command , that is currently executing is EndEditModeAndCommitRecord you can cancel the event using e.Cancel = true;
I have modified sample application I have sent in my previous post with the above mentioned functionality.
Please find the modified sample application and feel free to let me know if you have any further questions on this matter.
Hi Gergana
Still no good luck. In my code EndEditModeAndCommitRecord command is getting fired only for visible records. For the virtualized records it is not getting fired only RecordNext and StartEditMode commands are getting fired.
I have been looking into your post.
Would you please modify the sample application I have provided in my previous post with the functionality you are using? Once you provide me with the modified sample application I would be able to further investigate this matter for you.
I have tried to replicate the issue in your project but couldn't do so. The code I am working on is bit complex and huge.
However there is one thing that I noticed.
Before executing the RecordNext command I tried to find the CellValuePresenter of the next record and I get some value. But when I execute the RecordNext command and again try finding the CellValuePresenter it comes null.
This happens for all the row which are not visible at the moment. From the hidden rows for some I get the CellValuePresenter and for those rows the fields gets into edit mode.
Also if I scroll to the bottom of grid exposing every row to visible area and then hit enter repeatedly then in this case the cell of next records enter the Edit mode.
As the issue cannot be reproduced in the sample application I have provided in one of my previous responses I can suggest updating the version you are using to the latest version of our controls - 15.1.
If the issue is still reproducible in the latest version(15.1) we would need a simple isolated sample application, that shows the issue that you are seeing in order for us to be able to investigate this matter.
Please do not hesitate to let me know if you have any further questions on this matter.
Still no luck
I have been looking into your posts.
Due to the virtualization of the XamDataGrid only the CellValuePresenters are created when the application is started. Would you please try calling the UpdateLayout method of the xamDataGrid, before trying to enter in edit mode. More about this method you can find here: http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v15.1~Infragistics.Windows.DataPresenter.XamDataGrid_members.html#.
Should I assume that this thread is dead now?
One last thing of anyone is looking at it. It I scroll till the bottom of the grid and then scroll back and now if I press enter after editing the cell then the next record's cell always enter the edit. Unlike the previous condition here the hidded records cell also get edited
I have tried to replicate the issue in your code but was unsuccessful, might be because of the complexity of my code and the way it has been implemented. All I could help you is that the moment I execute RecordNext command the CellValuePresenter gets null and the cell refuses to go to edit mode.