XPTable.Models.Table.OnHorizontalScroll C# (CSharp) Method

OnHorizontalScroll() protected method

Occurs when the Table's horizontal scrollbar is scrolled
protected OnHorizontalScroll ( object sender, ScrollEventArgs e ) : void
sender object The object that Raised the event
e ScrollEventArgs A ScrollEventArgs that contains the event data
return void
        protected void OnHorizontalScroll(object sender, ScrollEventArgs e)
        {
            // stop editing as the editor doesn't move while
            // the table scrolls
            if (this.IsEditing)
            {
                this.StopEditing();
            }

            if (this.CanRaiseEvents)
            {
                // non-solid row lines develop artifacts while scrolling
                // with the thumb so we invalidate the table once thumb
                // scrolling has finished to make them look nice again
                if (e.Type == ScrollEventType.ThumbPosition)
                {
                    if (this.GridLineStyle != GridLineStyle.Solid)
                    {
                        if (this.GridLines == GridLines.Rows || this.GridLines == GridLines.Both)
                        {
                            this.Invalidate(this.CellDataRect, false);
                        }
                    }

                    // same with the focus rect
                    if (this.FocusedCell != CellPos.Empty)
                    {
                        this.Invalidate(this.CellRect(this.FocusedCell), false);
                    }
                }
                else
                {
                    this.HorizontalScroll(e.NewValue);
                }
            }
        }
Table