Introduction
If a collection is on a form, the user generally is gong to need a way to edit its values. Putting editable controls directly in the data table is one way to accomplish this.
Prerequisites
- The data table must already exist.
- Delete order should be configured in the entity.
|
Quick Steps |
| 1 |
Select the collapsible control |
| 2 |
Change the data table field control types |
| 3 |
Select the data table and set Selection |
| 4 |
Insert a row above the data table and add a DetailView Update button |
| 5 |
Update the Update button properties |
| 6 |
Add a Delete button to the right of the Update button |
| 7 |
Update the Delete button properties |
| 8 |
Save the form |
Detailed Steps
Step 1. Select the collapsible control.
Select the collapsible control whose data table you want to enable editing. This example selects the Order Details collapsible control.
Step 2. Change the data table field control types.
Change all the data table fields except the primary key. That should always be read-only.
All of the data table controls that may be editable have now been changed. The primary key should never be editable.
Step 3. Select the data table and set Selection.
You're going to add a Delete button for the data table, so set the Selection property to One, to be able to select and delete a record from the data table.
Step 4. Insert a row above the data table and add a DetailView Update button.
This row will contain the buttons the user will use to edit the Data Table.
Step 5. Update the Update button properties.
The properties to update are:
- ID: Programmatic ID of the button.
- Caption: Button text the user sees. From their perspective, this is the name of the button.
- Related Control: Data table this button affects. In this case, that's grvLstOrderDetails.
- Add: If set to True, the button adds a new record to the data table. If it is False, the button acts as an update button.
Step 6. Add a Delete button to the right of the Update button.
This button deletes selected rows from the data table.
Step 7. Update the Delete button properties.
You have to enter all the same properties as the DetailView Update button: ID, Caption, and Related Control (grvLstOrderDetails).
Also, for this button to function properly, make sure delete order is configured in the entity.
Step 8. Save the form.
Then, run a preview. Xelence displays the form output. You can test your updated settings.
When you have previewed your form, it should look something like this.
What are the improvements over S3 Version 6?
Previously, to be able to make the grid editable, the description fields had to be changed to value fields. Now, this change is not required. The Picklist field can be value or description, the Framework understands and updates the record changes done, if any.
This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.
#Xelence
#Forms