See Also
Enumerations
Name | Values |
WidthTypes | Pixels |
Percentage |
Constants
Name | Type | Value |
| | This class exposes no constants. |
Events
Definition | Description |
| This class does not expose any events. |
Methods
Definition | Description |
Constructor( colID as String, colTitle as String ) | Creates an instance of this class with the parameters as property values. |
Properties
Name | Type | Default Value | Description |
ContextMenu | GraffitiMenuItem | Nil | Enables the automatic display of already configured and added GraffitiMenuItems instances without a round-trip to the server |
DecimalPlacesMax | Integer | 4 | Applies only to columns with FormatType and EditType = Double or Currency. |
DecimalPlacesMin | Integer | 0 | Applies only to columns with FormatType and EditType = Double or Currency. |
Editor | GraffitiWebGrid.EditTypes | None | Determines the editor type to be used. See EditTypes Enumeration of GraffitiWebGrid. |
EditorButtonCaption | String | “” | Caption to display in the button of the EditTypes.TextWithButton editor. Supports FontAwesome icons in the format <fas fa-search> |
EditorButtonIndicator | WebUIControl.Indicators | Default | Bootstrap indicator to apply to the button of an editor that possesses one. |
EditorButtonTooltip | String | “” | Tooltip to display when the user hovers their mouse over the button of an editor that possesses one. |
EditorFieldReadOnly | Boolean | False | When True and column is of type EditTypes.TextWithButton, the text field will be read only. |
Focusable | Boolean | True | Determines whether this column’s cells will accept focus. |
Formatter | GraffitiWebGrid.FormatTypes | Text | Determines how the values for this column are formatted for display. |
FormatterJavaScript | String | “” | JavaScript function used to format cell values when Formatter = FormatTypes.JavaScript. |
HeaderStyle | WebStyle | Nil | Overrides the default style and the StyleHeader property of the containing Grid. |
ID | String | “” | The identifier for the column’s values. Values should be alphanumeric with no special characters such as underscore(_) or hyphen(-), and are case-sensitive. This should not be changed outside the Constructor. Spaces are also disallowed. Should not contain only a number or start with a number. |
IntegerValueMax | Integer | 100 | Maximum value allowed in the Integer editor. |
IntegerValueMin | Integer | 0 | Minimum value allowed in the Integer editor. Negative numbers are supported. |
MaxWidth | Integer | 0 | The maximum width this column can have within the display. |
MinWidth | Integer | 0 | The minimum width this column can have within the display. |
PercentScale | GraffitiGridPercentScale | Nil | GraffitiGridPercentScale object that is applied to cell values when using FormatTypes.Percentage. |
PopupMenuAllowEmpty | Boolean | False | When True, the PopupMenu editor must have a valid selection. |
PopupMenuPlaceholder | String | “” | The placeholder text for the PopupMenu editor. |
PopupMenuValue() | String | Empty Array | Possible values for the user to select in the PopupMenu editor. |
ProgressAnimated | Boolean | False | When True, the Progress formatter will animated its value. Note that this will have no effect if ProgressStriped = False. |
ProgressStriped | Boolean | False | When True, the progress value will have stripes drawn across its face. |
Resizeable | Boolean | False | Determines whether this column can be resized. |
Selectable | Boolean | False | Determines whether this column can be selected by clicking the header. |
Sortable | Boolean | True | Determines whether the user can sort the rows by clicking this column's header. |
SortDirection ReadOnly | GraffitiWebGrid.SortDirections | None | Returns the current sort direction value. |
Style | WebStyle | Nil | Style applied to row cells in this column. Overrides everything except for style specified by AddCellStyle. |
Tag | Variant | Nil | Use for storing things like your database field key. This value has no functional application beyond being used for your reference. |
Title | String | “” | The displayed title for the column in the header. |
Tooltip | String | “” | The tip text displayed when the mouse hovers over the column header. |
Visible | Boolean | True | The current visible state of the column. |
Width | Integer | 0 | The width for the column. |
WidthType | WidthTypes | Pixels | Determines whether the Width property will be interpreted as a pixel value or a percentage. |
ZeroValueOverride | String | “” | String to display when Double or Currency cell values are equal to 0.0. Leave empty to display actual value. |
Examples
Styling
To style the header, you can make use of GraffitiStyles to achieve the desired effect. To center text in the column header, you can use the following:
var gridColumnCenter as GraffitiStyle = GraffitiStyle.Create( Session, "gridColumnCenter", "text-align:center;justify-content:center" )
myColumn.HeaderStyle = gridColumnCenter
To style all of the row cells in a column, you can assign the gridColumnCenter
object as defined above to the Style property of the column:
myColumn.Style = gridColumnCenter
One important note is that row cells use flexbox. This means that you'll need to use the justify-content
CSS attribute to center text, and other changes may need flexbox-specific attributes.
To right-align text in cells, you'll need to use the flex-end
value of the justify-content
CSS attribute, like so:
var gridColumnRight as GraffitiStyle = GraffitiStyle.Create( Session, "gridColumnRight", "text-align:right;justify-content:flex-end" )