예제 #1
0
        protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
        {
            object result;

            if (value is Enum)
            {
                result = DataGridViewEnumCell.GetDescription((Enum)value);
            }
            else
            {
                result = base.GetFormattedValue(value, rowIndex, ref cellStyle, valueTypeConverter, formattedValueTypeConverter, context);
            }
            return(result);
        }
예제 #2
0
 public DataGridViewEnumColumn()
 {
     CellTemplate = new DataGridViewEnumCell();
 }