I am using UltraGrid in Infragistics NetAdvantage 9.1 WinForm.Basically, i am adding a KeyActionMapping so that pressing the Enter key will navigate down the grid. GridKeyActionMapping keyActionMapping = new GridKeyActionMapping(Keys.Enter, UltraGridAction.BelowCell, 0, UltraGridState.Cell, Infragistics.Win.SpecialKeys.All, 0); ultraGrid.KeyActionMappings.Add(keyActionMapping);
But I also want it to wrap around, ie. if user press Enter key in a cell at the very last row, the active focus will shift to the next cell by tab in the FIRST row
I was experimenting with the following, but it activates the whole first row instead of the cell that i want it to.
keyActionMapping =
new GridKeyActionMapping(Keys.Enter, UltraGridAction.FirstRowInBand, 0, UltraGridState.LastRowInGrid, Infragistics.Win.SpecialKeys.All, 0);Could you please advise on how this could be achieve? Thanx.
Hi,
My guess is that the firstRowInBand sets the ActiveRow, but not the ActiveCell. So you probably need to add two mappings with the same conditions, but with two different actions.
The grid determines first which actions to perform and then performs them in order. So if you have two actions with exactly the same criteria, they will both get performed in sequence.
Another option would be to simply stick with the one action you have and then handle the last row case by using the BeforePerformAction event.