So I\'ve been looking to set a default value for my combobox. I found a few things but none of them seem to work.
Actually, it works if I create a simple combobox and us
My solution:
int? defaultID = null; foreach (DataRow dr in dataSource.Tables["DataTableName"].Rows) { if ((dr["Name"] != DBNull.Value) && ((string)dr["Name"] == "Default Name")) { defaultID = (int)dr["ID"]; } } if (defaultID != null) comboBox.SelectedValue = defaultID;