Error while inserting value in to cells in a grid 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

Error while inserting value in to cells in a grid in wxpython

Post by pikkip »

I am getting the following error while inserting values in the cells of grid in wxPython:

wx._core.PyAssertionError: C++ assertion "(row >= 0 && row < GetNumberRows()) && (col >= 0 && col < GetNumberCols())" failed at ..\..\src\generic\grid.cpp(1305) in wxGridStringTable::SetValue(): invalid row or column index in wxGridStringTable.

Can anyone tell me what is the reason for this??? :(
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Error while inserting value in to cells in a grid in wxpython

Post by doublemax »

The error message is as clear as it gets. You're trying to set a value outside the grid size. E.g. if your grid is 5x5 and you're trying to set the value for cell (6,6), you get that error.

Did you call wxGrid::CreateGrid()?
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: Error while inserting value in to cells in a grid in wxpython

Post by pikkip »

Thank you. Yes
Post Reply