Scripting > CxHmiGrp > CxGrpGrid Object > CxGrpGrid Events

CxGrpGrid Events

The CxGrpGrid object contains the following events:

ContextMenu

Select a custom context menu item.

Syntax

CxGrpGridObject_EventContextMenu(Col As Long, Row As Long, EventID As String)

Parameters

Parameter Required Description

Col

Yes

The column number of the cell that was right-clicked.

Row

Yes

The row number of the cell that was right-clicked.

EventID

Yes

The ID of the custom context menu item that was clicked.

Remarks

Note that this event fires only if a custom context menu item is selected (in other words, a menu itemthat was added via the Custom Context Menu Configuration dialog box in the OCX Properties).

Example

The following example handles a custom context menu item.

Sub GrpGrid_EventContextMenu(Col, Row, EventID)

Dim This : Set This = GrpGrid

 

If EventID = "CLEAR_CELL" Then

GrpGrid.X.SetCellValue Col, Row, 0

End If

 

End Sub

Back to top

DClick

Double-click on a cell.

Syntax

CxGrpGridObject_EventDClick(Column As Long, Row As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was double-clicked.

Row

Yes

The row number that was double-clicked.

Example

The following example displays cell properties in a message box when a cell is double-clicked.

Sub GrpGrid_EventDClick(Column, Row)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Cell Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Col UDC: " + GrpGrid.X.ColUdc(Column) + vbCr

strMsg = strMsg + "Row Facility: " + GrpGrid.X.RowFacility(Row) + vbCr

strMsg = strMsg + "Cell Value: " + GrpGrid.X.GetCellValue(Column, Row)

 

MsgBox strMsg

 

End Sub

Back to top

DClickCol

Double-click a column header.

Syntax

CxGrpGridObject_EventDClickCol(Column As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was double-clicked.

Example

The following example displays column properties in a message box when a column header is double-clicked.

Sub GrpGrid_EventDClickCol(Column)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Column Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Col UDC: " + GrpGrid.X.ColUdc(Column)

 

MsgBox strMsg

 

End Sub

Back to top

DClickCorner

Double-click on the corner cell.

Syntax

CxGrpGridObject_EventDClickCorner()

Example

The following example displays grid properties in a message box when the corner cell is double-clicked.

Sub GrpGrid_EventDClickCorner()

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Cell Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Default Facility: " + GrpGrid.X.Facility + vbCr

strMsg = strMsg + "Column Count: " + CStr(GrpGrid.X.Columns) + vbCr

strMsg = strMsg + "Corner Label: " + GrpGrid.X.CornerLabelText

 

MsgBox strMsg

 

End Sub

Back to top

DClickRow

Double-click a row header.

Syntax

CxGrpGridObject_EventDClickRow(Row As Long)

Parameters

Parameter Required Description

Row

Yes

The row number that was double-clicked.

Example

The following example displays row properties in a message box when a row header is double-clicked.

Sub GrpGrid_EventDClickRow(Row)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Row Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Row Facility: " + GrpGrid.X.RowFacility(Row)

 

MsgBox strMsg

 

End Sub

Back to top

LClick

Left-click a cell.

Syntax

CxGrpGridObject_EventLClick(Column As Long, Row As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was left-clicked.

Row

Yes

The row number that was left-clicked.

Example

The following example displays the cell value in a message box when a cell is left-clicked.

Sub GrpGrid_EventLClick(Column, Row)

Dim This : Set This = GrpGrid

 

MsgBox GrpGrid.X.GetCellValue(Column, Row)

 

End Sub

Back to top

LClickCol

Left-click a column header.

Syntax

CxGrpGridObject_EventLClickCol(Column As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was left-clicked.

Example

The following example displays the column UDC in a message box when a column header is left-clicked.

Sub GrpGrid_EventLClickCol(Column)

Dim This : Set This = GrpGrid

 

MsgBox GrpGrid.X.ColUdc(Column)

 

End Sub

Back to top

LClickCorner

Left-click the corner cell.

Syntax

CxGrpGridObject_EventLClickCorner()

Example

The following example displays the corner label in a message box when the corner cell is left-clicked.

Sub GrpGrid_EventLClickCorner()

Dim This : Set This = GrpGrid

 

MsgBox GrpGrid.X.CornerLabelText

 

End Sub

Back to top

LClickRow

Left-click a row header.

Syntax

CxGrpGridObject_EventLClickRow(Row As Long)

Parameters

Parameter Required Description

Row

Yes

The row number that was left-clicked.

Example

The following example displays the row facility in a message box when a row header is left-clicked.

Sub GrpGrid_EventLClickRow(Row)

Dim This : Set This = GrpGrid

 

MsgBox GrpGrid.X.RowFacility(Row)

 

End Sub

Back to top

RClick

Right-click a cell.

Syntax

CxGrpGridObject_EventRClick(Column As Long, Row As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was right-clicked.

Row

Yes

The row number that was right-clicked.

Example

The following example displays cell properties in a message box when the cell is right-clicked.

Sub GrpGrid_EventRClick(Column, Row)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Cell Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Col UDC: " + GrpGrid.X.ColUdc(Column) + vbCr

strMsg = strMsg + "Row Facility: " + GrpGrid.X.RowFacility(Row) + vbCr

strMsg = strMsg + "Cell Value: " + GrpGrid.X.GetCellValue(Column, Row)

 

MsgBox strMsg

 

End Sub

Back to top

RClickCol

Right-click a column header.

Syntax

CxGrpGridObject_EventRClickCol(Column As Long)

Parameters

Parameter Required Description

Column

Yes

The column number that was right-clicked on.

Example

The following example displays column properties in a message box when a column header is right-clicked.

Sub GrpGrid_EventRClickCol(Column)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Column Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Col UDC: " + GrpGrid.X.ColUdc(Column)

 

MsgBox strMsg

 

End Sub

Back to top

RClickCorner

Right-click the corner cell.

Syntax

CxGrpGridObject_EventRClickCorner()

Example

The following example displays grid properties in a message box when the corner cell is right-clicked.

Sub GrpGrid_EventRClickCorner()

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Cell Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Default Facility: " + GrpGrid.X.Facility + vbCr

strMsg = strMsg + "Column Count: " + CStr(GrpGrid.X.Columns) + vbCr

strMsg = strMsg + "Corner Label: " + GrpGrid.X.CornerLabelText

 

MsgBox strMsg

 

End Sub

Back to top

RClickRow

Right-click a row header.

Syntax

CxGrpGridObject_EventRClickRow(Row As Long)

Parameters

Parameter Required Description

Row

Yes

The row number that was right-clicked.

Example

The following example displays row properties in a message box when a row header is right-clicked.

Sub GrpGrid_EventRClickRow(Row)

Dim This : Set This = GrpGrid

 

Dim strMsg

strMsg = "Row Details" + vbCr + vbCr

strMsg = strMsg + "Site.Service: " + GrpNavBar.X.SiteService + vbCr

strMsg = strMsg + "Row Facility: " + GrpGrid.X.RowFacility(Row)

 

MsgBox strMsg

 

End Sub

Back to top

RowChange

The selected row changed.

Syntax

CxGrpGridObject_EventRowChange(OldRow As Long, NewRow As Long)

Parameters

Parameter Required Description

OldRow

Yes

The row that was previously selected.

NewRow

Yes

The row that is now selected.

Example

The following example displays the newly-selected row’s facility when the row is changed.

Sub GrpGrid_EventRowChange(OldRow, NewRow)

Dim This : Set This = GrpGrid

 

eboSelectedFacility = GrpGrid.X.RowFacility(NewRow)

 

End Sub

Back to top

TrendAddTag

Context menu item Trend|Add Point selected.

Syntax

CxGrpGridObject_EventTrendAddTag(Tag As String)

Parameters

Parameter Required Description

Tag

Yes

The tag of the selected cell.

Example

The following example displays the trended point.

Sub GrpGrid_EventTrendAddTag(Tag)

Dim This : Set This = GrpGrid

 

eboLastAction.Text = "Point " + Tag + " added to trend"

 

End Sub

Back to top

TrendRemoveTag

Context menu item Trend|Remove Point selected.

Syntax

CxGrpGridObject_EventTrendRemoveTag(Tag As String)

Parameters

Parameter Required Description

Tag

Yes

The tag of the selected cell.

Example

The following example displays the point removed from the trend.

Sub GrpGrid_EventTrendRemoveTag(Tag)

Dim This : Set This = GrpGrid

 

eboLastAction.Text = "Point " + Tag + " removed from trend"

 

End Sub

Back to top

TrendSingleTag

Context menu item Trend|Show Single Point selected.

Syntax

CxGrpGridObject_EventTrendSingleTag(Tag As String)

Parameters

Parameter Required Description

Tag

Yes

The tag of the selected cell.

Example

The following example displays the trended point.

Sub GrpGrid_EventTrendSingleTag(Tag)

Dim This : Set This = GrpGrid

 

eboLastAction.Text = "Point " + Tag + " viewed in trend"

 

End Sub

Back to top

TrendSingleTagRollup

Context menu item Trend|Show Single Point with Rollups selected.

Syntax

CxGrpGridObject_EventTrendSingleTagRollup(Tag As String)

Parameters

Parameter Required Description

Tag

Yes

The tag of the selected cell.

Example

The following example displays the trended point.

Sub GrpGrid_EventTrendSingleTagRollup(Tag)

Dim This : Set This = GrpGrid

 

eboLastAction.Text = "Point " + Tag + " viewed in trend with rollups"

 

End Sub

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.