Help me!
On UltraGrid, when moving up, down (arrow keys), UltraGrid moves left, right. How to fix?
Thank you very much.
Hello Tai,
Our developer finished reviewing in UltraGrid, when moving up and down using arrow keys, UltraGrid moves left and right issue.
The cause of this behavior in the attached sample is that the grid is using RowLayouts and in RowLayout mode the layout of the cell is extremely flexible. This sample has a very simple layout with the columns arranged in a single horizontal line, but the layout could include cells that overlap, multiple levels, nested groups, etc. It is therefore nearly impossible for the grid to determine which cell the arrow keys should navigate to in any given arbitrary layout. So it doesn't try. It’s left to the developer to handle the keyboard navigation based on their layout. In this case, since the layout is so simple, this is very easy to do. For example, you can write something like this to handle the keyboard navigation:
private void ultraGrid1_BeforePerformAction(object sender, Infragistics.Win.UltraWinGrid.BeforeUltraGridPerformActionEventArgs e) { switch (e.UltraGridAction) { case Infragistics.Win.UltraWinGrid.UltraGridAction.AboveCell: case Infragistics.Win.UltraWinGrid.UltraGridAction.BelowCell: var grid = (UltraGrid)sender; var activeCell = grid.ActiveCell; if (null == activeCell) return; var activeRow = activeCell.Row; SiblingRow siblingRowDirection = e.UltraGridAction == Infragistics.Win.UltraWinGrid.UltraGridAction.BelowCell ? SiblingRow.Next : SiblingRow.Previous; var siblingRow = activeRow.GetSibling(siblingRowDirection); if (null != siblingRow) { siblingRow.Cells[activeCell.Column].Activate(); e.Cancel = true; } break; } }Please let me know if I may be of further assistance.
Sincerely,Sahaja KokkalagaddaAssociate Software Developer
I have investigated In UltraGrid, when moving up and down using arrow keys, UltraGrid moves left and right issue, and I have asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 247528. This will be assigned to a developer in a future sprint to review my investigation and confirm my findings or to offer a fix, or other resolution.
Once we receive any update from the developer I will post it here.
Please let me know if you need more information.
Thank you for sending us the sample for this issue. I will test the attached sample to observe the mentioned behaviour and will send you an update by end of day Tuesday.
Additionally, I would like to inform you that our office is closed on January 1st, 2018 for NewYear holiday and we will review any updates once we are back.
Many thanks to Noriko I for replying.The problem only occurs when grouping the columns of WinGrid. I have sent you an attachment to ask for your help.Best Regards
WindowsFormsApp1.rar
Hello tai tran van,
I followed the steps you suggested and was unable to reproduce the behavior you're describing.I created a new Windows Forms application, just added a ultraGrid and bound it to a datasource.And I ran the application and hit [Up] and [Down] keys several times to see whether the symptom that the ultraGrid moves left and right is reproduced, but the cell/row selection/activation moves up and down expectedly.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. This can be done by either making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.
Please let me know if I can provide any further assistance.
Best Regards,
Noriko I.Developer Support EngineerInfragistics, Inc.WindowsFormsApp1.zip