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
I have found this way:
DataTable hierarchies = new DataTable();
cmbHierarchies.BeginUpdate();
cmbHierarchies.ValueMember = this.Value;
cmbHierarchies.DisplayMember = this.Display;
hierarchies = DataView.ToTable();
cmbHierarchies.DataSource = table;
cmbHierarchies.EndUpdate();
//Add empty row
DataRow row = table.NewRow();
table.Rows.InsertAt(row, 0);
cmbHierarchies.SelectedIndex = 0;