Editing data lists
ListCtrl
provides a nice way to display tabular data to users, though in its normal form, it only offers a read-only display of data. If you also wish to allow users to interact with and edit data, there are some additional steps that need to be taken. The LC_EDIT
style flag can be used to allow the editing of data, but this only works for the first column of ListCtrl
. Luckily, to overcome this limitation and enable the editing of any cell in LC_REPORT
mode, the wx.lib.mixins.listctrl
module has a mixin class to help provide this functionality. So, let's take a look at how to make a ListCtrl
editable.
Getting ready
We will use the example code from the previous recipe in this chapter, Displaying lists of data, as a base for showing the extended functionality of editing ListCtrl
in this recipe. So, ensure that you check over the contents of the preceding recipe before continuing with this one.
How to do it…
Here are the steps to perform in this recipe:
First, we need a few...