I'm having difficulty getting a wxGrid object to reflect data changes
using the wxGrid.ForceRefresh method. I've researched this on the
message archive and it seems this may be an on-going issue. Maybe the
solution has been posted already but I've missed something somewhere.
My simple print statements indicate that the underlying data has been changed
Per one suggestion I've added a wxGrid.StartBatch() call prior to
making my data changes and then followed with a wxGrid.EndBatch()
call. According to the documentation this should cause the grid to be
repainted.
No luck so far.
I am attaching a runnable sample file that illustrates the situation.
Thanks in advance for any helpful suggestions.
Note – Only the “Sort By Home Score” button has any data changing code
attached to it.
Well, since the only thing being done here is sorting g.data, and the data in the grid is not being touched at all, then all that is happening is the grid is being redrawn with its current, unchanged, state.
If you want the data in the external structure to be the same data used by the grid (instead of a copy of it like you are doing with the SetCellValue calls) then take a look at the Grid samples that have their own table class and use SetTable instead of CreateGrid.
···
On 9/18/10 1:03 PM, John Asnin wrote:
I'm having difficulty getting a wxGrid object to reflect data changes
using the wxGrid.ForceRefresh method. I've researched this on the
message archive and it seems this may be an on-going issue. Maybe the
solution has been posted already but I've missed something somewhere.
My simple print statements indicate that the underlying data has been changed
Per one suggestion I've added a wxGrid.StartBatch() call prior to
making my data changes and then followed with a wxGrid.EndBatch()
call. According to the documentation this should cause the grid to be
repainted.