On Apr 2, 2011, at 8:50 AM, Rasmus Schøler Sørensen wrote:
> I was a little puzzled of why inBatch=True has such a destructive
> influence; after all, I did call fillGrid(force=True) TWICE after I
> have added my columns. (And I have previously been able to use the
> exact same setup in other non-wizard forms!) -- Even if I ran
> fillGrid(force=True) every time I added a column, it didn't help.
Sorry, I clicked 'Send' before answering your other questions.
fillGrid(force=True) fills the grid's table with data, but if the table
doesn't know about its columns (which is the part that inBatch skips), it has
nothing to fill. In short, fillGrid doesn't touch the columns; it assumes that
they are already configured.
> Looking into dGrid.py I found that _syncColumnCount() is not called in
> batch mode (or is fillGrid). If I added a call to the grid's
> _syncColumnCount after adding all columns, then everything worked. :-)
Exactly.
> But of course, methods starting with underscore should not be used
> directly by me as a user. I've tried to find an "official" way to
> invoke _syncColumnCount, which could include: showing or removing
> individual columns or setting the DataSet, "Width" or "Visible"
> properties. E.g. just call column.Visible = True on any one of the
> columns.
That's why I was thinking that 'inBatch' should have been labeled
'_inBatch', since it really is an optimization that was meant to be set only at
the framework level.
> Hehe, sorry it got a little bit of a long story -- I was digging while
> writing, so it likely got a bit too detailed.
Digging is a great way to learn, as long as it's not too frustrating!
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]