On a winform there is a combobox that derives its information from a datatable. The datatable draws from a database list.
this.cboList.DataSource = pullData();
this.cboList.DisplayMember = "fieldA";
Once the DataSource is set I am not able to insert a default row (ie *) as the first item in the combobox.
I tried this:
this.cboList.Items.Insert(0,"*");
Is there a way to insert in the combobox after the datasource is set or should this be done in the datatable?
UPDATE1:
The solution looks something like this:
var list = mydt.AsEnumerable().Select(row => row.Field<string>(fieldName)).ToList();
list.Insert(0, "*");
Where mydt is a populated datatable and fieldName is a variable holding the database field name.