Page 1 of 1

wxGrid with combobox (Choice Editor)

Posted: Mon Dec 17, 2012 4:58 pm
by Lech Kozarski
Hi.
I use the combobox wxGrid. Unfortunately, at the opening of the grid does not show me the combobox on the screen.
I have to click the mouse in this field to display it.
The sample 2.9.4 is unfortunately the same problem. ( I run wxWidgets 2.9.4 // Windows 7 64 bit // CodeBlocks )
How this can be called without the use of mouse ?
I trayed Refresh but it not work.

code:
wxString choices[3]={wxT("TEST"), wxT("TEST2"), wxT("TEST3")}; // Make table strings
Grid1->SetCellEditor(0,0, new wxGridCellChoiceEditor(3, choices, false)); // Add this to Cell
Grid1->SetCellValue(wxT("TEST2"),0,0); // Set default value
Grid1->Refresh();

Any help please....

Thanks

Re: wxGrid with combobox (Choice Editor)

Posted: Mon Dec 17, 2012 5:36 pm
by doublemax

Code: Select all

Grid1->SetGridCursor(0, 0);
Grid1->ShowCellEditControl();
Try this, untested.

And it only works for one control at a time, you can't have a cell editor open for multiple cells. What you actually want - embed any control in a wxGrid cell - is not supported AFAIK.

Re: wxGrid with combobox (Choice Editor)

Posted: Mon Dec 17, 2012 7:29 pm
by Lech Kozarski
It's not work ;(
1. When I open my Dialog I have this :
image1.png
image1.png (17 KiB) Viewed 2718 times
2. I need this ( without click mouse ):
The attachment image2.png is no longer available
Thanks

Re: wxGrid with combobox (Choice Editor)

Posted: Mon Dec 17, 2012 7:53 pm
by doublemax
Try this:

Code: Select all

Grid1->SetGridCursor(0, 0);
Grid1->EnableCellEditControl(true);
Grid1->ShowCellEditControl();

Re: wxGrid with combobox (Choice Editor)

Posted: Mon Dec 17, 2012 8:09 pm
by Lech Kozarski
WOW It is works.
Thank you very much. :D

Re: wxGrid with combobox (Choice Editor)

Posted: Tue May 30, 2017 2:12 pm
by nandakishore
How to get the event when combobox selection is changed?