using System; using System.Collections.Generic; using System.Data; using System.Text; using System.Windows.Forms; namespace GridTest { public class DataGridViewCustomColumn : DataGridViewColumn { public DataGridViewCustomColumn() : base(new DataGridViewCustomCell()) { } public override DataGridViewCell CellTemplate { get { return base.CellTemplate; } set { // Ensure that the cell used for the template is a CalendarCell. if (value != null && !value.GetType().IsAssignableFrom(typeof(DataGridViewCustomCell))) { throw new InvalidCastException("Must be a Custom ComboBox Cell!"); } base.CellTemplate = value; } } } }