Hello,
When I move between rows with the key board arrow it moves between the group name, but I want to move between the children.
Hi,
To get to a child row, you have to use the Right arrow, instead of down.
If you want the down arrow to go to the child rows, you would either have to update the KeyActionMappings on the grid, or handle the BeforePerformAction event. The event is probably easier. Something like this:
private void ultraGrid1_BeforePerformAction(object sender, BeforeUltraGridPerformActionEventArgs e) { UltraGrid grid = (UltraGrid)sender; switch (e.UltraGridAction) { case UltraGridAction.BelowRow: e.Cancel = true; grid.PerformAction(UltraGridAction.NextRowByTab, false, false); break; case UltraGridAction.Above: e.Cancel = true; grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); break; } }
hi
I am using below code for grid navigation using Up arrow and Down arrow and also tabs, problem here is this works fine when the grid is nor filtered, but when user filter the grid, next row is not the filtered row but showing actual old row in the grid which is hidden on filter and which is previously listed while binding the grid.
private void ugMappingGrid_BeforePerformAction(object sender, BeforeUltraGridPerformActionEventArgs e) { UltraGrid grid = (UltraGrid)sender; grid.ActiveRow.Selected = false; contextMenu.Hide(); if (rowsSelected != null) rowsSelected.Clear(); switch (e.UltraGridAction) { case UltraGridAction.NextRowByTab: case UltraGridAction.BelowRow: e.Cancel = true; if (grid.ActiveRow.HasNextSibling()) { UltraGridRow nextRow = grid.ActiveRow.GetSibling(SiblingRow.Next); grid.ActiveRow = nextRow; grid.ActiveRow.Selected = true; DisplayDataInDetailsPane(nextRow); EnableUserActionButtons(nextRow); } break; case UltraGridAction.PrevRowByTab: case UltraGridAction.AboveRow: e.Cancel = true; if (grid.ActiveRow.HasPrevSibling()) { UltraGridRow prevRow = grid.ActiveRow.GetSibling(SiblingRow.Previous); grid.ActiveRow = prevRow; grid.ActiveRow.Selected = true; DisplayDataInDetailsPane(prevRow); EnableUserActionButtons(prevRow); }break;
Your code is not skipping filtered-out rows because your code is calling GetSibling and this method does not skip filtered rows. If you want to skip the filtered rows, then you can check the row.HiddenResolved property and get the next row and so on until you find one that is not hidden.
Or, you could do what I did and use an existing UltraGridAction that does what you want instead of trying to get the row and activate it yourself.