protected override void OnGotFocus(EventArgs e)
{
if (this.FocusedCell.IsEmpty)
{
CellPos p = this.FindNextVisibleCell(this.FocusedCell, true, true, true, true, true);
if (this.IsValidCell(p))
{
this.FocusedCell = p;
}
}
else
{
this.RaiseCellGotFocus(this.FocusedCell);
}
if (this.SelectedIndicies.Length > 0)
{
this.Invalidate(this.CellDataRect);
}
if (this.BorderColor != this.UnfocusedBorderColor)
this.Invalidate(false);
base.OnGotFocus(e);
}