Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Page up/down in multi band grid
posted

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

 

Parents
  • 469350
    Suggested Answer
    Offline posted

    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;
                }
            }

Reply Children