DeleteGridRows method (WinStudio scripts)

Applies To

IWSFormComponents interface, unbound grid components

Definition

Deletes rows from an unbound grid component.

Syntax

object.DeleteGridRows( integer1, integer2 )

  Part   Description
object Required. The name of a valid grid component.
integer1 Required. An integer indicating the first row to delete. Row 0 is the row of column titles at the top of the grid component. Row 1 is the first data row.
integer2 Required. An integer indicating the number of rows to delete.

Remarks

This method cannot delete row 0 (the header row).

If this method deletes the current row, the GetGridCurrentCol method returns the index for the column that was current in the deleted row and the GetGridCurrentRow method returns the index of the deleted row. To avoid this result, your application must set a new current row. The SetGridCurrentCell method sets both the current row and the current column.

Example

Sub Main()
   Dim oGrid As IWSFormComponent
   oGrid = ThisForm.Components( "MrpPlanviewTempsGrid" )
   
   ' Delete the first two rows
   oGrid.DeleteGridRows (1, 2)
   
   ' Delete rows 4 through 6  
   ThisForm.Components( "MrpPlanviewTempsGrid" ).DeleteGridRows(4, 3) 
   ThisForm.Components( "MrpPlanviewTempsGrid" ).IDOCollection.NotifyDependentsToRefresh("")
End Sub