Ask Your Question
0

How to obtain a Null value in combo boxes?

asked 2023-03-24 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-01-22 07:00:00 +0000

ladyg gravatar image

To obtain a Null value in a combo box, you can follow these steps:

  1. Add a new item to the combo box by typing in the word "Null" as the display text.
  2. Set the value of this item to be null or an empty string.
  3. Set the combo box's SelectedIndex property to -1, which will clear any selected item and display the Null item as the default value.

Alternatively, you can set the combo box's DataSource property to a list that includes a null value or an empty string as the first item. This way, users can select this item to indicate a null value.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-24 11:00:00 +0000

Seen: 18 times

Last updated: Jan 22 '23