I have loaded few wxGrid cells with wxGridCellChoiceRenderer and wxGridCellBoolRenderer randomly.
I click on any cell which may have renderers or empty cells. So in EVT_GRID_CELL_LEFT_CLICK event how to know that
that cell have the renderer and which type of renderer it is?
How to get the type of grid cell renderer ? Topic is solved
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
How to get the type of grid cell renderer ?
Got a Problem???..No worry..Focus on Solution not on Problem
Re: How to get the type of grid cell renderer ?
I've never tried it, but you might get some love from using IsKindOf() on the event object
http://docs.wxwidgets.org/trunk/classwx ... 713404b01e
http://docs.wxwidgets.org/trunk/classwx ... 713404b01e
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
Re: How to get the type of grid cell renderer ?
I have already tried this But no use.
when we query the grid like GetCellRenderer() it will give the renderer
then from the renderer there is no function called IsKindOf.
when we query the grid like GetCellRenderer() it will give the renderer
then from the renderer there is no function called IsKindOf.
Got a Problem???..No worry..Focus on Solution not on Problem
Re: How to get the type of grid cell renderer ?
If this information is not easily available, it's a good indicator that you're doing something wrong or at least unusual. For what purpose do you need this information in a click event handler?
Use the source, Luke!
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
Re: How to get the type of grid cell renderer ?
I fill gird cells with combo box renderer and button renderer randomly so i need to know what kind of renderer does the cell havedoublemax wrote:If this information is not easily available, it's a good indicator that you're doing something wrong or at least unusual. For what purpose do you need this information in a click event handler?
when EVT_GRID_CELL_LEFT_CLICK this event is triggered .
Got a Problem???..No worry..Focus on Solution not on Problem
Re: How to get the type of grid cell renderer ?
But why? Don't the cells have different celleditors assigned to them which will take care of the editing for you?
Use the source, Luke!
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
Re: How to get the type of grid cell renderer ?
I can differentiate the renderers by setting setclientdata() like below in wxGridCellButtonRenderered and wxGridCellChoiceRenderer
SetClientData("Button Renderer");
SetClientData("Combo Renderer");
in EVT_GRID_CELL_LEFT_CLICK event function i can get the clientdata and get the task done
char* rendererinfo = (char*)cellren->GetClientData();
SetClientData("Button Renderer");
SetClientData("Combo Renderer");
in EVT_GRID_CELL_LEFT_CLICK event function i can get the clientdata and get the task done
char* rendererinfo = (char*)cellren->GetClientData();
Got a Problem???..No worry..Focus on Solution not on Problem