wxGrid with combobox (Choice Editor) Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Lech Kozarski
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sat Nov 26, 2011 3:15 pm

wxGrid with combobox (Choice Editor)

Post 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
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGrid with combobox (Choice Editor)

Post 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.
Use the source, Luke!
Lech Kozarski
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sat Nov 26, 2011 3:15 pm

Re: wxGrid with combobox (Choice Editor)

Post by Lech Kozarski »

It's not work ;(
1. When I open my Dialog I have this :
image1.png
image1.png (17 KiB) Viewed 4588 times
2. I need this ( without click mouse ):
The attachment image2.png is no longer available
Thanks
Attachments
image2.png
image2.png (20.52 KiB) Viewed 4588 times
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGrid with combobox (Choice Editor)

Post by doublemax »

Try this:

Code: Select all

Grid1->SetGridCursor(0, 0);
Grid1->EnableCellEditControl(true);
Grid1->ShowCellEditControl();
Use the source, Luke!
Lech Kozarski
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sat Nov 26, 2011 3:15 pm

Re: wxGrid with combobox (Choice Editor)

Post by Lech Kozarski »

WOW It is works.
Thank you very much. :D
nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Re: wxGrid with combobox (Choice Editor)

Post by nandakishore »

How to get the event when combobox selection is changed?
Got a Problem???..No worry..Focus on Solution not on Problem :P
Post Reply