autocomplete in datagraid
-
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (dataGridView1.CurrentCellAddress.X == 1) { TextBox txt = e.Control as TextBox; txt.AutoCompleteCustomSource = ItemCode; txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txt.AutoCompleteSource = AutoCompleteSource.CustomSource; e.CellStyle.ForeColor = Color.Red; } } i use this cod to assign auto Complete to the text box in data grid it work well but it work for all text boxes After my text i need to assign for it :(
ahmed eldeghedy
-
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (dataGridView1.CurrentCellAddress.X == 1) { TextBox txt = e.Control as TextBox; txt.AutoCompleteCustomSource = ItemCode; txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txt.AutoCompleteSource = AutoCompleteSource.CustomSource; e.CellStyle.ForeColor = Color.Red; } } i use this cod to assign auto Complete to the text box in data grid it work well but it work for all text boxes After my text i need to assign for it :(
ahmed eldeghedy
Have you tried using the debugger to see what is being passed as the X value ?
Christian Graus Driven to the arms of OSX by Vista.