I have a dataGridView that contain a DataGridViewTextBoxColumn and also a DataGridViewComboBoxColumn. The comboBox is bound to a dataSource, but textBox is not.
I want that when the TextBox changed, the selectedValue of comboBox set to textBox text.
When i put this code in cellLeave handler of dataGridView, the selectedValue of comboBox not change! This is because this handler fires up before changing the value of textBox.
((DataGridViewComboBoxCell)DgvA.Rows[DgvA.SelectedRows[0].Index].Cells[1]).Value = DgvA.Rows[DgvA.SelectedRows[0].Index].Cells[0].Value;
Does someone know how to do this?
CellLeave
event when theCellValueChanged
? It is fired exactly when you're wanting... when the cell's value is changed. – AnthonyDataGridViewTextBoxEditingControl
mentioned in the answer below. – Anthony