Defining a Datagrid column
When a Datagrid component is first added to the workspace, column headers are automatically given generic names (Column 1, Column 2, and so on). To make the column headers more useful, you likely want to rename them.
In addition, for a Datagrid to be useful, you must tell App Builder where to find the contents for each column, whether to allow users to select or alter the contents of cells, and what format to apply to the contents of each cell in a column.
- In the workspace, select the Datagrid component.
- In the Properties panel, select the Content tab.
- Click to expand the Columns option.
- In the list of columns, click the name of the column you want to define.
-
Use the Edit Datagrid Column dialog box to
make the settings for the column:
- In the Name field, type the name of the column as you want it to appear in the header row.
- Click to expand the Source Field section.
- Use the Value field to select the desired source for the column.
- Click to expand the Options section.
- Set the Options as desired:
- Editable - This option determines whether users can edit the contents of cells in this column. To make the column cells read-only, clear this check box.
- Resizable - This option determines whether users can change the size of the Datagrid. To prevent users from resizing the Datagrid, clear this check box.
- Sortable - This option determines whether users can sort the rows of columns by clicking inside the header of one column. For example, to sort the rows alphabetically by the contents in Column 1, users can click inside the column header, and rows are sorted in alternating ascending/descending order.
- Click to expand the Formatter section.
- From the list of possible formats (Type), select the one to use as the
default format for that column's contents.
Depending on the Type you select, you might be prompted for additional criteria.
- Optionally, to create a summary row for a column with numeric values,
expand the Summary Row
section, and make these settings:
- Enable - When selected, this option causes a summary row to be created for the column. Otherwise, no summary row is created or displayed.
- Text - This option specifies the text to display before the summary total; for example: Total:
- Text Placement - Select whether to display the text before the number or after the number. For example, do you want it to display as "Total: 122" (Before) or "122 Total" (After)?
- Optionally, to allow one property value to display in place of a
specified property value, expand the Substitute Value section, and make these settings:
- Enable - When this option is selected, the other Substitute Value settings take effect. Ohterwise, any values in the other settings are ignored.
- Data Service - From the drop-down list,
select the data service to serve as the source of the column
display. This data service must contain both the property for
the Source and the
property for the Display
Value. Note: You can use only data services that do not use input parameters.
- Source - From the drop-down list, select the property to use as the source for the data.
- Display Value - From the drop-down list, select the property to use for the display of the specified source data.
- Click Save.