private void scrollTimer_Tick(object sender, EventArgs e) { if (this.scrollDelta == 0 || this.tableElement == null) { return; } RadScrollBarElement scrollBarElement = Control.ModifierKeys != Keys.Shift ? this.tableElement.VScrollBar : this.tableElement.HScrollBar; int num = scrollBarElement.Value + this.scrollDelta; if (num < scrollBarElement.Minimum) { num = scrollBarElement.Minimum; } else if (num > scrollBarElement.Maximum - scrollBarElement.LargeChange + 1) { num = scrollBarElement.Maximum - scrollBarElement.LargeChange + 1; } if (scrollBarElement.LargeChange > 0) { scrollBarElement.Value = num; } if (this.scrollReason == BaseGridBehavior.ScrollReason.PageUp) { this.NavigateToPage(this.GetFirstScrollableRow(this.tableElement, true), Keys.None); } else if (this.scrollReason == BaseGridBehavior.ScrollReason.PageDown) { this.NavigateToPage(this.GetLastScrollableRow(this.tableElement), Keys.None); this.GridViewElement.TableElement.RowScroller.UpdateScrollRange(); } this.scrollReason = BaseGridBehavior.ScrollReason.MouseWheel; this.scrollDelta = 0; this.scrollTimer.Stop(); }
protected virtual bool ProcessPageDownKey(KeyEventArgs keys) { this.tableElement = (GridTableElement)this.GridViewElement.CurrentView; if (this.scrollDelta == 0) { this.scrollReason = BaseGridBehavior.ScrollReason.PageDown; this.scrollTimer.Start(); } this.scrollDelta += this.tableElement.ViewElement.ScrollableRows.Size.Height + (int)this.tableElement.ViewElement.ScrollableRows.ScrollOffset.Height; return(true); }
public BaseGridBehavior() { this.rowBehaviors = (IDictionary <System.Type, IGridBehavior>) new Dictionary <System.Type, IGridBehavior>(); this.scrollReason = BaseGridBehavior.ScrollReason.MouseWheel; this.lockedBehavior = (IGridBehavior)null; this.originalCursor = (Cursor)null; this.scrollBarAtPoint = (RadScrollBarElement)null; this.defaultRowBehavior = new GridRowBehavior(); this.RegisterBehavior(typeof(GridViewDataRowInfo), (IGridBehavior) new GridDataRowBehavior()); this.RegisterBehavior(typeof(GridViewNewRowInfo), (IGridBehavior) new GridNewRowBehavior()); this.RegisterBehavior(typeof(GridViewGroupRowInfo), (IGridBehavior) new GridGroupRowBehavior()); this.RegisterBehavior(typeof(GridViewFilteringRowInfo), (IGridBehavior) new GridFilterRowBehavior()); this.RegisterBehavior(typeof(GridViewTableHeaderRowInfo), (IGridBehavior) new GridHeaderRowBehavior()); this.RegisterBehavior(typeof(GridViewSearchRowInfo), (IGridBehavior) new GridSearchRowBehavior()); this.RegisterBehavior(typeof(GridViewHierarchyRowInfo), (IGridBehavior) new GridHierarchyRowBehavior()); this.RegisterBehavior(typeof(GridViewDetailsRowInfo), (IGridBehavior) new GridDetailViewRowBehavior()); this.scrollTimer = new Timer(); this.scrollTimer.Interval = 10; this.scrollTimer.Tick += new EventHandler(this.scrollTimer_Tick); }
protected virtual bool ProcessPageUpKey(KeyEventArgs keys) { this.tableElement = (GridTableElement)this.GridViewElement.CurrentView; if (this.tableElement.ViewElement.ScrollableRows.Children.Count == 0) { return(false); } GridRowElement child = this.tableElement.ViewElement.ScrollableRows.Children[0] as GridRowElement; if (child == null) { return(false); } if (this.scrollDelta == 0) { this.scrollReason = BaseGridBehavior.ScrollReason.PageUp; this.scrollTimer.Start(); } this.scrollDelta -= this.tableElement.ViewElement.ScrollableRows.Size.Height + (child.Size.Height - (int)this.tableElement.ViewElement.ScrollableRows.ScrollOffset.Height + this.tableElement.RowSpacing); return(true); }