Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex==0)
{
//SendKeys.Send("{F2}");
dataGridView1.BeginEdit(true);
comboBox1.Visible = true;
comboBox1.Location = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;
comboBox1.Size = dataGridView1.CurrentCell.Size;
comboBox1.Focus();
}
}



C#
dataGridView1.BeginEdit(true);

if i use above code then combobox dropdown property is not working

C#
SendKeys.Send("{F2}");

if use this combo is not available in firstRow for editmode on keypress
Posted
Comments
George Jonsson 27-Oct-14 4:47am    
Is comboBox1 of type DataGridViewComboBoxCell?
ranjeet11 27-Oct-14 5:41am    
No.its another physical control on the form.
http://www.codeproject.com/Questions/830157/put-the-System-Windows-Form-ComboBox-in-Datagridvi?arn=0
this link contain full code
George Jonsson 27-Oct-14 6:34am    
So why not use DataGridViewComboBoxCell? It is kind of made specially for presenting a combobox in a DataGridView.
ranjeet11 27-Oct-14 7:02am    
DataGridViewComboBoxCell is not editable & its dropdown list gives problem for oprating through keyboard. please give solution of above problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900