I have an issue with typing in zeros in a combobox that is layed over a datagridview cell. It essentially clears out everything in front of it. This only happens on the first time you enter the cell. If you retype in the same cell while that same cell is active, it lets you type in everything. Has anyone ever heard of this issue before? Can anyone shed some light as to what makes it behave that way? This is only happening when I try to enter a 4-digit year.
My datagridview cell click (relevant) code:
if (dataGridView1.CurrentCell.ColumnIndex == 3)
comboBox1.Text = "";
SqlCeCommand year_comm = new SqlCeCommand("SELECT DISTINCT year FROM vehicles ORDER BY year DESC", conn);
year_comm.CommandType = CommandType.Text;
SqlCeDataReader year_dr = year_comm.ExecuteReader();
My combobox text changed code:
private void comboBox1_TextChanged(object sender, EventArgs e)
if (comboBox1.Text != "")
dataGridView1.CurrentCell.Value = comboBox1.Text;
Any help/pointers will be appreciated.
If I type in "2014" in the first time, I should see 2014.
What I see the first time is after the 0, I don't see the 2 anymore until I retype it.