Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I want to display the combo box inside the grid cell's when i double clicked on the cell. After the combo box open, on click the combo i want to display a new grid.

i have tried some code..

C#
private ComboBox combo = new ComboBox();
       private void PONewMain_Load(object sender, EventArgs e)
       {
           combo.Hide();
           this.dataGridView1.Controls.Add(combo);

           string s = cmb_purchase.Text;

C#
}


C#
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
       {


C#
this.combo.Location = this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;

C#
combo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            this.combo.Show();

C#
}



It displaying the combo box, but i dont know how to set a event on combo mouseclick in the grid combo..

Please help

Thanks in advance
Posted
Updated 25-Feb-13 20:43pm
v2

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