DataGridViewComboBoxCell Binding - “value is not valid”

前端 未结 10 792
臣服心动
臣服心动 2020-11-30 09:45

I\'m trying to bind separate ComboBox cells within a DataGridView to a custom class, and keep getting an error

DataGridViewComboBoxCell value is not v

10条回答
  •  温柔的废话
    2020-11-30 10:23

    Here's my simple solution when using enums

    ColumnType.ValueType = typeof (MyEnum);
    ColumnType.DataSource = Enum.GetValues(typeof (MyEnum));
    

    you can do that just after "InitializeComponent();"

提交回复
热议问题