wxGrid does not update after a change on PyGridTableBase


Hi, I have continued my experiments with the fantastic wxPython library.

Today I had to create a simple grid, so I followed some tutorials and read some documentation on how to use wx.grid.Grid along with wx.grid.PyGridTableBase, in a very MVC-ish fashion. The thing is, that I correctly set up both (you can look up tutorials online on how to use them, or the fantastic wxPython in Action book (which was published back in 2006, making it a little bit old, but very a very useful and educational resource nonetheless). But when invoking the AppendRows or DeleteRows on the grid, I saw no change in the Grid’s presentation (although I double checked that the table’s AppendRows and DeleteRows where called accordingly).

But thanks to the wonders of the lazyweb, I found my answer in this very useful post:

http://groups.google.com/group/wxpython-users/msg/f02fb345ef0b35cf

So, all I had to do was to send the corresponding message  on my table’s AppendRows and DeleteRows methods and all worked just fine.

Hope you find that useful too.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s