Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The following two sample programs show you how to edit tables. We first show you how to edit individual table cells. Then we give an example of deleting table rows. The same technique would work for adding rows. When you implement commands that affect individual rows, your application needs to have a way of finding out which rows the user selected. Each example shows a different approach for identifying the user selections.
To edit table cells, you provide an input component for the cell you want to edit. The application shown in Figure 6–9 allows editing of all its cells. You click a checkbox to edit a row and then click the “Save Changes” button to save your changes. From top to bottom, Figure 6–9 shows a cell being edited.