Click here to Skip to main content
11,412,526 members (72,497 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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..

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;
}

private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
       {

this.combo.Location = this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;
combo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            this.combo.Show();
}


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 25-Feb-13 21:42pm
Edited 25-Feb-13 21:43pm
v2

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

  Print Answers RSS
0 OriginalGriff 384
1 Sascha Lefévre 200
2 Maciej Los 155
3 ProgramFOX 130
4 Sergey Alexandrovich Kryukov 110
0 Sergey Alexandrovich Kryukov 9,025
1 OriginalGriff 7,247
2 Maciej Los 3,525
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150427.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100