GetGridValueByColumnName method (WinStudio scripts)

Applies To

IWSFormComponent interface, grid components

Definition

Returns the value of a cell in the specified grid component, using the column name to specify the column.

Syntax

object.GetGridValueByColumnName( integer, string )

  Part   Description
object Required. A reference to a valid grid component.
integer Required. Integer indicating the row number.
string Required. String indicating the name of the column.

Remarks

The return value is a string containing the value of the designated cell.

The index for the row number is not zero-based. In a grid, the first row is row 1.

If the row number is 0, the caption of the grid column component is returned.

Example

Sub Main()
   Dim cellValue As String
   Dim curRow As Integer
   curRow = ThisForm.Components("grid1").GetGridCurrentRow()
   cellValue = ThisForm.Components("grid1"). _
      GetGridValueByColumnName(curRow, "gridColumn1")
   Application.ShowMessage("The event name for this row is: " _
      & vbLf & vbLf & "     " & cellValue)
End Sub