开发者

DataGridViewComboBox null values

开发者 https://www.devze.com 2023-01-11 17:39 出处:网络
I have a Windows forms DataGridView with a combobox column.The combo box column is bound to a data source that is populated from开发者_运维百科 a Linq to Entities query.I would like users to be able t

I have a Windows forms DataGridView with a combobox column. The combo box column is bound to a data source that is populated from开发者_运维百科 a Linq to Entities query. I would like users to be able to select "Nothing" in the combo box (assign a value of NULL to the underlying data source).

How can I accomplish this?


DataGridView supports the Ctrl+0 keystroke to enter a null value into a cell, so you can use that to clear out a combo box's value and set it back to null.

0

精彩评论

暂无评论...
验证码 换一张
取 消