Using Commands with GridWorX64 Viewer

Introduction

Before the introduction of Commanding it used to require scripting to interact with controls like the GridWorX64 Viewer. Commanding provides a simpler, more intuitive, and easier to maintain way to send these commands to controls.

 

This document will go over the commands that can be sent to or from a GridWorX Viewer. More information about Commanding in general or with respect to other controls can be found in other application notes or in the help files. 

 

If you are unfamiliar with any aspects of Commanding, please refer to the application note entitled, “GENESIS64 – Commanding Introduction” to get started.

 

NOTE: All properties named Index are zero-based, meaning the first object always has an Index of 0.

Commands with a GridWorX64 Viewer Target

Expand Collapse

When grouping is enabled the Expand Collapse command will expand or collapse those groups. The ExpandCollapse property determines whether the command will cause the groups to expand or collapse.  With regards to the GridWorX64 Viewer, Collapse does the same as CollapseAll and Expand does the same as ExpandAll.

 

The ItemName and Index properties of this command are not applicable to the GridWorX64 Viewer.

Group

The Group command adds or removes grouping for the GridWorX64 Viewer. The Action property determines whether groups are added or removed.

Use either the ItemName or Index properties to determine the column to group. ItemName is the name of the column you would like to group. If no ItemName is specified, the Index is used.

Load DataGrid Configuration

The Load DataGrid Configuration command will load a pre-created GridWorX64 Viewer configuration into the targeted GridWorX64 Viewer.

Navigate

The Navigate command will navigate forward or back through the pages of the GridWorX64 Viewer when there is more than one page.  The Navigate property determines how to navigate, and Steps determines how many pages to navigate.

Save Configuration

The Save Configuration command will save the GridworX64 Viewer configuration to the specified FileName. When Overwrite is True, an existing file with the specified name will be overwritten. 

NOTE: No message will be shown if the specified file already exists and Overwrite is set to False. The save action will simply not do anything in that case.

Select Element

The Select Element command allows you to change the tab or select a row of the GridWorX64 Viewer.  Element specifies the whether you are selecting a tab, grid, or row.  ElementName or Index are used to specify the particular tab, grid, or row to be selected.

Set Filter

The Filter command will apply the selected filter or filter expression to the GridWorX Viewer, or remove all filters. The Action property determines what action is taken.

FilterName is the name of a pre-existing filter to apply.  FilterExpression is the expression of a new filter to apply. 

NOTE: Because this command can be applied to many different types of targets, the FilterExpression field provides no help and has no error checking for expressions. Unless you are very familiar with the syntax it’s recommended that you use the filter editor within the GridWorX64 Viewer to compose your filter expressions, then copy and paste them into the FilterExpression field.

Set Global Aliases

The Set Global Aliases command sets global aliases for the targeted GridWorX64 Viewer.  This command is most useful when used to set global aliases for a GridWorX64 Viewer running within its own web part, otherwise it works the same as the standard Set Global Aliases pick action within GraphWorX64.

Set Visibility

The Set Visibility command allows you to hide or show columns in the GridWorX64 Viewer. For a GridWorX64 Viewer target, the ObjectType must be set to Column. Visual and Pen ObjectTypes do not apply to the GridWorX64 Viewer.

 

ObjectName is the name of the column whose visibility you want to change. If ObjectName is not specified, Index is used.

 

The Visibility property specifies whether you want the command to show the column, hide it, or toggle between hidden and shown.

Sort

The Sort command applies sorting to the specified column of the GridWorX64 Viewer. The Action property determines whether the command will replace existing sorting, add to it, or remove it. 

Use either the ItemName or Index properties to determine the column to sort. ItemName is the name of the column you would like to sort. If no ItemName is specified, the Index is used.

 

The Direction property specifies whether to sort Ascending or Descending.

Commands Sent From GridWorX64 Viewer

Set Time Range

The Set Time Range command can actually be sent from a GridWorX display to another control capable of receiving a Set Time Range command, like the TrendWorX64 Viewer.

 

No configuration is required on the GridWorX64 Viewer to prepare it to send a Set Time Range command.

 

To send a Set Time Range command, select any two date/time cells (use the Shift of Ctrl keys to select more than one cell), then right-click on the GridWorX64 Viewer, go to the Set Time Range sub-menu, and choose one of the objects in the list to send the time range.

 

The cells you select do not need to be in the same row or column, nor do they even need to be adjacent.

 

Figure 1 - Set Time Range Command

 

NOTE: Remember that the CommandingEnabled property must be set for the target of this command, and that you can set the CommandingDisplayName property to your control it a friendly name for this menu.

 

See Also:

Adding a GridWorX64 Viewer

Commanding