Issue regarding setting value in a grid cell in wxpython Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
User avatar
pikkip
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Sep 26, 2016 6:08 am

Issue regarding setting value in a grid cell in wxpython

Post by pikkip » Mon Oct 24, 2016 10:23 am

I have derived a class from wxGridBaseTable. I have to set the values of grid cells using data retrieved from database. I tried overriding grid.SetValue(self, row, col, val) but it din't work. Any idea what might have gone wrong? :(

User avatar
doublemax
Moderator
Moderator
Posts: 13992
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Issue regarding setting value in a grid cell in wxpython

Post by doublemax » Mon Oct 24, 2016 12:03 pm

Is the wxGridTableBase accesses your database, you don't need to write the values from the database into it. The database *is* your data source for the grid, no other copy of the data should exist.

Did you use wxGrid::SetTable() to set the new wxGridTableBase ?
http://docs.wxwidgets.org/trunk/classwx ... e3d9bcb5d5
Use the source, Luke!

User avatar
pikkip
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Sep 26, 2016 6:08 am

Re: Issue regarding setting value in a grid cell in wxpython

Post by pikkip » Tue Oct 25, 2016 6:47 am

I didi use wxGrid::SetTable() to set the new table. I recognised that I had duplicate copies of the data existing. Thank you!!! :D

Post Reply