I'm not sure where to start looking to handle this - key mapping, or trying to modify the scroll activity, or.....
Ultragrid 9.2
I have a main band, Band 0, with 2 children, Band 1 and Band 2. Bands 1 & 2 are at the same 'level' - they both show up when you expand a row in band 0.
When all are expanded for a Band 0 row, they take up the full display, no part of the child row is below the visible grid.
When the user presses pageup/down, or clicks in the scroll band or arrows, I want the next Band 0 row to be positioned at the top of the grid. Right now it just activates up the next band 1, then band 2, then it needs to scroll to see the next band 0 , band 1, band 2....
I want a 'page' to be a full set of expanded band 0,1,2. I thought page up/down flipped through a single band, but I can't get the Band 0 to move to the top of the grid if it's displayed lower down in the grid.
Where should I start looking?
Thanks, Robin
Hi Robin,
There are a lot of unknowns here regarding the exact behavior you want. But this should get you started in the right direction:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.ScrollBounds = ScrollBounds.ScrollToFill; } private void ultraGrid1_KeyDown(object sender, KeyEventArgs e) { UltraGrid grid = (UltraGrid)sender; switch (e.KeyCode) { case Keys.PageDown: case Keys.PageUp: UltraGridRow row = grid.ActiveRowScrollRegion.FirstRow; if (row == null) return; while (row.Band.Index != 0) row = row.ParentRow; SiblingRow siblingRow = (e.KeyCode == Keys.PageDown) ? SiblingRow.Next : SiblingRow.Previous; row = row.GetSibling(siblingRow, false); if (row != null) grid.ActiveRowScrollRegion.FirstRow = row; e.Handled = true; break; } }
Thank you Mike! Above and beyond as usual - you are extremely helpful.You must dream this stuff lol....
I think this is really close to what I need. I was getting tangled up into which event to use and how to use the .FirstRow. Learn something new every day!
Robin