[wxPython-users] Grid not deleting, but appending row on DeleteRow
Michael J. Pedersen
m.pedersen at icelus.org
Thu Jun 1 13:59:36 PDT 2006
On Thu, Jun 01, 2006 at 10:37:10PM +0200, Simen Haugen wrote:
> I have a custom table and grid, and when I try to delete rows, the grid
> "Appends" another row and doesn't remove any rows.
First, allow the mostly clueless to try and answer :)
I think you're not handling the deletion of the row correctly. Here's
some code I've got which deletes a row:
msg = wx.grid.GridTableMessage(self, wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED, self.dbnames.index(name), 1)
self.GetView().ProcessTableMessage(msg)
I have an array of dbnames in my custom table. I'm trying to delete the
row which contains the "name" variable. So, make a message, specifying
which table it comes from (self), what is being done
(wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED), the index of the row being
deleted (self.dbnames.index(name)), and how many rows are being deleted
(1). After that, make sure that the grid itself processes the update.
I hope this is of some use!
--
Michael J. Pedersen
My IM IDs: Jabber/pedersen at icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
Yahoo/pedermj2002, MSN/pedermj022171 at hotmail.com
My GnuPG KeyID: 4E724A60 My Public Key Available At: pgp.mit.edu
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02 233D D8DD 985E 4E72 4A60
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20060601/63e5480d/attachment.pgp
More information about the wxpython-users
mailing list