Spread Windows Forms 6.0 Product Documentation
NextNonEmptyRow Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > BaseSheetDataModel Class : NextNonEmptyRow Method


row
Row index after which to start searching (-1 to start at row 0)

Glossary Item Box

Gets the index of the next row that contains data.

Syntax

Visual Basic (Declaration) 
Public Overridable Function NextNonEmptyRow( _
   ByVal row As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As BaseSheetDataModel
Dim row As Integer
Dim value As Integer
 
value = instance.NextNonEmptyRow(row)
C# 
public virtual int NextNonEmptyRow( 
   int row
)

Parameters

row
Row index after which to start searching (-1 to start at row 0)

Return Value

Integer row index for the next cell in the column containing a value, or -1 if no row contain a value

Example

This example returns the index of the next row that contains data.
C#Copy Code
Random r = new Random();
int i, j; 
for (i = 1; i <= 50; i++)
{
       for (j = 1; j <= 3; j++)
       {
              fpSpread1.ActiveSheet.SetValue(i, j, r.Next(1, 200).ToString());
       }

}
FarPoint.Win.Spread.Model.BaseSheetDataModel bsm;
bsm = (FarPoint.Win.Spread.Model.BaseSheetDataModel)fpSpread1.ActiveSheet.Models.Data;
MessageBox.Show(bsm.NextNonEmptyRow(1).ToString());    
Visual BasicCopy Code
Dim r As New Random
Dim i, j As Integer
For i = 1 To 50
       For j = 1 To 3
              FpSpread1.ActiveSheet.SetValue(i, j, r.Next(1, 200).ToString())
       Next j
Next i

Dim bsm As FarPoint.Win.Spread.Model.BaseSheetDataModel
bsm = FpSpread1.ActiveSheet.Models.Data
MessageBox.Show(bsm.NextNonEmptyRow(1).ToString())

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.