WinStudio

GetGridCurrentCol Method

Applies To

IWSFormComponents interface, unbound grid components and grid components bound to secondary collections

Definition

Returns the index number of the current column in an unbound grid component or a grid component bound to a secondary collection.

Syntax

object.GetGridCurrentCol( )

  Part

  Description

object Required. A reference to a valid grid component.

Remarks

The return value is an integer representing the index number for the current column in the grid component. The index is zero-based. Column 0 is the column of row numbers on the grid component.

Example

Sub Main()
   Dim oGrid As IWSFormComponent
   Dim iCurrentRow As Integer
   Dim iCurrentColumn As Integer
   Dim iRowCount As Integer
   oGrid = ThisForm.Components("grid1")
   iCurrentRow = oGrid.GetGridCurrentRow()
   iCurrentColumn = ThisForm.Components("grid1").GetGridCurrentCol()
   iRowCount = ThisForm.Components("grid1").GetGridRowCount()
   'Display row, column, and row count numbers in a message box.
   Application.ShowMessage("Row = " & iCurrentRow.ToString() & vbLf & _
      "Column = " & iCurrentColumn.ToString() & vbLf & _
      "Number of rows = " & iRowCount.ToString())
End Sub

Related Topics

DeleteGridRows Method

GetGridCurrentRow Method

GetGridRowCount Method

InsertGridRows Method

SetGridCurrentCell Method