How to insert 'Empty' field in ComboBox bound to DataTable

后端 未结 13 1442
谎友^
谎友^ 2020-12-14 09:07

I have a combo box on a WinForms app in which an item may be selected, but it is not mandatory. I therefore need an \'Empty\' first item to indicate that no value has been s

13条回答
  •  悲&欢浪女
    2020-12-14 09:15

    I would bind the data then insert an blank item at position 0 using the ComboxBox.Items.Insert method. Similar to what flipdoubt suggested, but it adds the item to the top.

提交回复
热议问题