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