/// <summary> /// Checks if control is placed on table header /// </summary> /// <param name="control"></param> /// <returns></returns> private bool ShouldSetHeaderColor(Control control) { TableControl table = control.Parent as TableControl; return(table.IsControlOnHeaderArea(control) && (table.GetHeaderBGColor() != Color.Empty)); }