If you use the wx.LC_VIRTUAL style then the listctrl will ask you (via
overridden callback methods) for the values as they are needed for
display. IOW you do not load all the values into the listctrl when you
create it, so if you delete a column and add it again later you still
have the data available to display in that column. You'll just want to
come up with a good way to map your data values to the rows/cols of the
listctrl that takes into account that some data cols may not have active
listctrl cols.
--
Robin Dunn
Software Craftsman
http://wxPython.org
Another possibility would be to use UltimateListCtrl in wx.lib.agw,
which allows hiding/showing columns by calling
SetColumnShown(column_number, show=True). More docs:
http://xoomer.virgilio.it/infinity77/AGW_Docs/ultimatelistctrl.UltimateListCtrl.html
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
There isn't actually a way to do it, the header height is pulled out
using wx.RendererNative:
wx.RendererNative.Get().GetHeaderButtonHeight(listctrl)
But it should be easy enough to add. If you can enter a bug report on
wxTrac that would be most helpful, so that I don't lose track of this
improvement (component=AGW).
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==
On 22 July 2011 00:33, Andrea Gavana wrote:
> On 15 July 2011 00:00, dtp lists wrote:
>> Andrea,
>>
>> The UltimateListCtrl is exactly what I was looking for! Thank you so
>> much. One quick question regarding the column header height... is that
>> adjustable somehow? The native wx.ListCtrl has a very thin header while the
>> ultimatelistctrl has a slightly thicker one. There does not seem to be a
>> straightforward way to resize the header hight via the API.
>
> There isn't actually a way to do it, the header height is pulled out
> using wx.RendererNative:
>
> wx.RendererNative.Get().GetHeaderButtonHeight(listctrl)
>
> But it should be easy enough to add. If you can enter a bug report on
> wxTrac that would be most helpful, so that I don't lose track of this
> improvement (component=AGW).
No need for a bug report, I just committed a fix in SVN which allows
to set a custom value for the header and footer height
(independently). You can now simply use:
list_control.SetHeaderHeight(30)
And it will do the job.