I am having a combo box and a textbox in my datagridview. What i would like to do is when i select a value from combo box and moves to the text box by using Tab i would like to display the selected value from the combo box in to that text box.
I tried by writing a dummy code in TabIndexchanged it does not work so can any one help me

Dorababu MekaPosted Mar 7, 2011, 11:24 PM
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
str = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
}
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.CurrentRow.Cells["Txt"].Value = str;
}
Sam HobbsPosted Mar 7, 2011, 9:49 PM
If it is a necessity that you not change the value in the TextBox until the focus moves to the TextBox, then you could do that using the Enter event for the TextBox. That will work regardless of how the focus moves to the TextBox.
Suthish NairPosted Mar 7, 2011, 2:53 PM
Jaganathan BantheswaranPosted Mar 7, 2011, 6:51 AM
There is no TabIndex property in DataGridTextBoxColumn and DataGridComboBoxColumn.
So you cant set the focus by pressing TAB i guess.