Page 1 of 1

Issue regarding setting value in a grid cell in wxpython

Posted: Mon Oct 24, 2016 10:23 am
by pikkip
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? :(

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

Posted: Mon Oct 24, 2016 12:03 pm
by doublemax
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

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

Posted: Tue Oct 25, 2016 6:47 am
by pikkip
I didi use wxGrid::SetTable() to set the new table. I recognised that I had duplicate copies of the data existing. Thank you!!! :D