Spread Windows Forms 12.0 Product Documentation
NextNonEmptyColumnInRow Method (BaseSheetDataModel)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > BaseSheetDataModel Class : NextNonEmptyColumnInRow Method
Row index to search
Column index before the column to start searching (-1 to start at column 0)
Gets the index of the next column in a specified row that contains data.
Syntax
'Declaration
 
Public Overridable Function NextNonEmptyColumnInRow( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As Integer
'Usage
 
Dim instance As BaseSheetDataModel
Dim row As Integer
Dim column As Integer
Dim value As Integer
 
value = instance.NextNonEmptyColumnInRow(row, column)
public virtual int NextNonEmptyColumnInRow( 
   int row,
   int column
)

Parameters

row
Row index to search
column
Column index before the column to start searching (-1 to start at column 0)

Return Value

Integer column index for the next cell in the row containing a value, or -1 if no columns contain a value
Example
This example returns the next column with data in the specified row.
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.NextNonEmptyColumnInRow(1, -1).ToString());    
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.NextNonEmptyColumnInRow(1, -1).ToString())
See Also

Reference

BaseSheetDataModel Class
BaseSheetDataModel Members