Getting Edited Text from a wxGrid

Hi,

I’m new to Python/wxPython. I’m developing a utility application that requires a wxGrid for displaying the contents of a database to a user. The user can add text to the contents of the wxGrid in a separate editable column and this is then stored in the database.

I’ve managed to create a wxGrid which displays the data and I’ve also enabled an editable column. What I’m not clear about is how to get the data (text) that the user enters. Ideally, I’d like to grab the text string when the user presses Return.

Do I use “OnEditorHidden” for something like this?

Cheers,

Chris

I think you would use

GetCellValue
(int row, int col) const
Returns the string contained in the cell at the specified location.
but i am as new as you so i wouldnt really know… you would have to call it on an event like button press… python and wxwidgets works (to me) kinda like visual basic with out all the nicities :slight_smile:

···

On Saturday, March 7, 2015 at 11:44:17 AM UTC-6, Chris Share wrote:

Hi,

I’m new to Python/wxPython. I’m developing a utility application that requires a wxGrid for displaying the contents of a database to a user. The user can add text to the contents of the wxGrid in a separate editable column and this is then stored in the database.

I’ve managed to create a wxGrid which displays the data and I’ve also enabled an editable column. What I’m not clear about is how to get the data (text) that the user enters. Ideally, I’d like to grab the text string when the user presses Return.

Do I use “OnEditorHidden” for something like this?

Cheers,

Chris

wxWidgets: wxGrid Class Reference <<< is a great source of examples

···

On Saturday, March 7, 2015 at 11:44:17 AM UTC-6, Chris Share wrote:

Hi,

I’m new to Python/wxPython. I’m developing a utility application that requires a wxGrid for displaying the contents of a database to a user. The user can add text to the contents of the wxGrid in a separate editable column and this is then stored in the database.

I’ve managed to create a wxGrid which displays the data and I’ve also enabled an editable column. What I’m not clear about is how to get the data (text) that the user enters. Ideally, I’d like to grab the text string when the user presses Return.

Do I use “OnEditorHidden” for something like this?

Cheers,

Chris

Chris Share wrote:

Hi,

I'm new to Python/wxPython. I'm developing a utility application that
requires a wxGrid for displaying the contents of a database to a user.
The user can add text to the contents of the wxGrid in a separate
editable column and this is then stored in the database.

I've managed to create a wxGrid which displays the data and I've also
enabled an editable column. What I'm not clear about is how to get the
data (text) that the user enters. Ideally, I'd like to grab the text
string when the user presses Return.

Do I use "OnEditorHidden" for something like this?

You probably want EVT_GRID_CELL_CHANGED, which is sent when the value of a cell is changed by the user.

···

--
Robin Dunn
Software Craftsman