[wxPython-users] Re: repopulating grid can't forcerefresh to
upate values
Robin Dunn
robin at alldunn.com
Tue Nov 14 12:56:04 PST 2006
Timothy Smith wrote:
> Christian Kristukat wrote:
>
>> Timothy Smith <timothy <at> open-networks.net> writes:
>>
>>
>>
>>> hello i'm going crazy trying to make this bloody grid show it's new
>>> data, it refuses to show it's new data even on forcerefresh
>>>
>>> self.RosterStaffGrid.ClearGrid()
>>>
>>> for memeber in Staff:
>>> Phone = str(memeber[0])
>>> Name = memeber[1]
>>> Group = memeber[2]
>>> if Group == self.parent.GetPageText(self.id).split(': ')[0]:
>>> self.RosterStaffGrid.table.data.append([Phone,Name,''])
>>> print self.RosterStaffGrid.table.data
>>> self.RosterStaffGrid.ForceRefresh()
>>
>> As you're using a custom TableBase, you have to tell the UI that the
>> data has
>> changed, by sending some event, whose name I do not remember at the
>> moment. Have
>> a look at the wxPython demo, there is at least one grid demo from
>> which you can
>> copy the necessary parts.
>>
> yeah i thought thats what ForceResfresh did?
If you're adding new data then you need to tell the grid that there are
new rows by sending it a GridTableMessage. See GridCustTable.py in the
demo.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list