Brian wrote:
> Is there a way to bind a nullable Enum property to a combo box?
>
> When choosing a value, and then leaving the combo box, the value reverts
> back to the original value. It seems the databinding doesn' accept the
> new value.
>
>
> To populate the combo box:
>
> cboPageMode.DataSource = Enum.GetValues(typeof(PageMode));
>
>
> And for the data binding:
>
> cboPageMode.DataBindings.Add("SelectedItem", _itemsDBS, "Mode");
I changed it to this, and it seems to work now:
cboPageMode.DataBindings.Add("SelectedItem", _itemsDBS,
"Mode", true,
System.Windows.Forms.DataSourceUpdateMode.OnValidation,
null);
|