/// <summary> /// This is overridden to raise the <see cref="IndicatorColumn.IndicatorClicked"/> event when an image /// is clicked. The event is not raised if <see cref="IsClickable"/> is set to false. /// </summary> /// <param name="e">The event arguments</param> protected override void OnContentClick(DataGridViewCellEventArgs e) { IndicatorColumn owner = base.OwningColumn as IndicatorColumn; if (this.IsClickable && base.DataGridView != null && owner != null && this.MouseImageIndex != -1 && this.MouseImageIndex < owner.ImageList.Images.Count) { IndicatorClickEventArgs clickArgs = new IndicatorClickEventArgs(e.ColumnIndex, e.RowIndex, this.MouseImageIndex, base.NewValue); owner.OnIndicatorClicked(clickArgs); if (!base.ReadOnly && ((clickArgs.Value == null && base.NewValue != null) || (clickArgs.Value != null && !clickArgs.Value.Equals(base.NewValue)))) { base.NewValue = clickArgs.Value; base.DataGridView.NotifyCurrentCellDirty(true); base.DataGridView.InvalidateCell(this); } } }