C# combobox in datagridview can not set Text <p>I am writing code that display datagridviewCombobox in datagridview , i made it display and bind data to this datagridviewCombobox success. But i have the problem, I can not setText to this datagridviewCombobox.</p> <p>With normal combobox, I just set cb.Text = "", or it automatically display text in index = 0, but with datagridviewCombobox , I can not find method that accept setText to this.</p> <p>Here is some information:</p> <p><a href="https://i.stack.imgur.com/8vjQq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8vjQq.png" alt="Here is list of datagridview Column"></a></p> <p>Now is code that i add row to datagridView</p> <pre><code>private void addNewBillRow() { DataGridViewTextBoxCell stt = new DataGridViewTextBoxCell(); stt.Value = dataGridView1.RowCount + 1; DataGridViewComboBoxCell cbProduct = new DataGridViewComboBoxCell(); initCellCombobox("Select * from Product", "ID", "ProductName", cbProduct, false); DataGridViewComboBoxCell cbUnit = new DataGridViewComboBoxCell(); DataGridViewTextBoxCell amount = new DataGridViewTextBoxCell(); amount.Value = numericUpDown1.Value.ToString(); DataGridViewTextBoxCell bill = new DataGridViewTextBoxCell(); bill.Value = textBox1.Text; DataGridViewTextBoxCell ck = new DataGridViewTextBoxCell(); ck.Value = textBox5.Text; DataGridViewTextBoxCell money = new DataGridViewTextBoxCell(); money.Value = textBox6.Text; DataGridViewComboBoxCell dbDoctor = new DataGridViewComboBoxCell(); initCellCombobox("Select * from Doctor", "ID", "DoctorName", dbDoctor, false); DataGridViewTextBoxCell description = new DataGridViewTextBoxCell(); description.Value = ""; DataGridViewRow row = new DataGridViewRow(); row.Cells.Add(stt); row.Cells.Add(cbProduct); row.Cells.Add(cbUnit); row.Cells.Add(amount); row.Cells.Add(bill); row.Cells.Add(ck); row.Cells.Add(money); row.Cells.Add(dbDoctor); row.Cells.Add(description); // Add the DataGridViewRow to the DataGridView: dataGridView1.Rows.Add(row); } </code></pre> <p>Then problem is when row added into datagridview, then I see that datagridviewCell didn't show default value ( index 0) , when I click into this datagridviewCell, now it dropdown data and fill the first value to datagridviewCell. I dont know data only show when click to this datagridviewCell .</p> <p>Here is the method I fill data to datagridviewComboBox:</p> <pre><code>private void initCellCombobox(String queryString, String key, String value, DataGridViewComboBoxCell combobox, bool isPutAll) { try { //Console.WriteLine(GlobalVar.Instance.ConnectionString); using (SqlConnection connection = new SqlConnection(GlobalVar.Instance.ConnectionString)) { SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); Dictionary&lt;string, string&gt; mapKeyValue = new Dictionary&lt;string, string&gt;(); if (!reader.HasRows) { combobox.Value = "Chưa có dữ liệu!"; return; } else { } if (isPutAll) { mapKeyValue.Add("-1", "Tất cả"); } while (reader.Read()) { mapKeyValue.Add(reader[key].ToString(), reader[value].ToString()); } combobox.DisplayMember = "value"; combobox.ValueMember = "key"; combobox.DataSource = new BindingSource(mapKeyValue, null); connection.Close(); } } catch (Exception ex) { //Console.WriteLine(ex.Message); MessageBox.Show("Không thể kết nối cơ sở dữ liệu: " + ex.Message); } } </code></pre> <p>Here is the picture when row just added to datagridview</p> <p><a href="https://i.stack.imgur.com/U8G8u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U8G8u.png" alt="enter image description here"></a></p> <p>When I click in to this datagridviewcombobox, It show the index 0 and show dropdown</p> <p><a href="https://i.stack.imgur.com/avvC7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/avvC7.png" alt="enter image description here"></a></p>