Currently I am using wxListCtrl to display data pulled from RDBMS. I now need to add the ability to edit existing rows, and add a new row.
It doesn't seem like wxListCtrl is 'meant' for this (editing all columns). The 'wxLC_EDIT_LABELS' style enables editing only the first column AFAIK. The events listed in the docs for wxListCtrl don't seem to make it easy either.
So, my question is what is the wxPython way to implement this. Something like an order-entry system where there is a variable number of 'line items'(each with several columns) displayed in a list, each column individually editable.
Currently I am using wxListCtrl to display data pulled from RDBMS. I now need to add the ability to edit existing rows, and add a new row.
It doesn't seem like wxListCtrl is 'meant' for this (editing all columns). The 'wxLC_EDIT_LABELS' style enables editing only the first column AFAIK. The events listed in the docs for wxListCtrl don't seem to make it easy either.
So, my question is what is the wxPython way to implement this. Something like an order-entry system where there is a variable number of 'line items'(each with several columns) displayed in a list, each column individually editable.
If you need to edit it in place, then use a wxGrid. If it's okay to popup a dialog or something to edit eaqch item then a wxListCtrl will still work.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Currently I am using wxListCtrl to display data pulled from RDBMS. I
now need to add the ability to edit existing rows, and add a new row.
It doesn't seem like wxListCtrl is 'meant' for this (editing all
columns). The 'wxLC_EDIT_LABELS' style enables editing only the first
column AFAIK. The events listed in the docs for wxListCtrl don't seem
to make it easy either.
So, my question is what is the wxPython way to implement this.
Something like an order-entry system where there is a variable number
of 'line items'(each with several columns) displayed in a list, each
column individually editable.
thanks,
Norman J. Harman Jr.
NAC Incorporated
A wxListCtrl should be regarded as a useful way of *displaying* rows and
columns of data. Confusion arises because the contents of the first column
*can* be edited but, I'm guessing, I think this carries over from its use
in applications like Windows Explorer where the first column is a file or
folder name that the user can change, but nothing else.
Have a look at the wxGrid control, which provides a rich set of events and
methods for both the display and modification of two-dimensional data and
where editors and data renderers can be specified in fine detail. The
grid-displayed data can also be mapped to an underlying table in ways that
I have only ever read about.
Regards,
David Hughes
Forestfield Software Ltd
www.forestfield.co.uk