Hi, we have a standard grid setup with grouping. However, if we click on the group, and press the right/left keys, navigation/focus moves to the data rows below/above and repeatedly pressing right/left will move down/up respectively. This is not the behaviour we expect, as the user wants to be able to navigate off the grid group header and move left/right on data cells without having to click on them with the mouse to restore "normal" navigation. Any ideas on how we can prevent this?
Hello gsharm3,
Could you please review the sample attached to this post and see if it meets your requirements.Please feel free to let me know if I misunderstood you or if you have any other questions.
Hi Boris,
This seems to select an arbitrary cell on mouse click. However, we want them to be able to selected the group still, and then press the right/left keyboard keys without the selection moving on to the datarows below (i.e. trapping the input). Would you advise simple capturing key_down events and blocking them if the group header is selected? Any input here appreciated. Thanks.
That does look better - thanks Mike.
This is better...
private bool flag; private void ultraGrid1_BeforePerformAction(object sender, BeforeUltraGridPerformActionEventArgs e) { UltraGrid grid =(UltraGrid)sender; if (e.UltraGridAction == UltraGridAction.NextRow && grid.ActiveRow.IsGroupByRow && grid.ActiveRow.Expanded && ((UltraGridGroupByRow)grid.ActiveRow).Rows.VisibleRowCount > 0) { this.flag = true; } } private void ultraGrid1_AfterPerformAction(object sender, AfterUltraGridPerformActionEventArgs e) { UltraGrid grid = (UltraGrid)sender; if (this.flag) { this.flag = false; grid.ActiveRow.Cells[0].Activate(); grid.ActiveRow.Cells[0].Selected = true; } }