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


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

Glossary Item Box

Returns the index of the next non-empty column in a row in the model.

Syntax

Visual Basic (Declaration) 
Public Overridable Function ConditionalFormatNextNonEmptyColumnInRow( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetStyleModel
Dim row As Integer
Dim column As Integer
Dim value As Integer
 
value = instance.ConditionalFormatNextNonEmptyColumnInRow(row, column)
C# 
public virtual int ConditionalFormatNextNonEmptyColumnInRow( 
   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 conditional format, or -1 if no columns contain a value

Example

C#Copy Code
FarPoint.Win.Spread.NamedStyle styleCold = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleCool = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleMild = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleWarm = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleHot = new FarPoint.Win.Spread.NamedStyle();
styleCold.BackColor = Color.Blue;
styleCold.ForeColor = Color.White;
styleCool.BackColor = Color.Cyan;
styleMild.BackColor = Color.Lime;
styleWarm.BackColor = Color.Yellow;
styleHot.BackColor = Color.Red;

if (fpSpread1.ActiveSheet.Models.Style is FarPoint.Win.Spread.IConditionalFormatSupport)
{
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleCold, FarPoint.Win.Spread.ComparisonOperator.LessThanOrEqualTo,
"40");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleCool, FarPoint.Win.Spread.ComparisonOperator.Between,
"40","55");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleMild, FarPoint.Win.Spread.ComparisonOperator.Between,
"55","75");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleWarm, FarPoint.Win.Spread.ComparisonOperator.Between,
"75","85");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleHot, FarPoint.Win.Spread.ComparisonOperator.GreaterThan,
"85");
}

int i;
i =((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).ConditionalFormatNextNonEmptyColumnInRow(1,
-1);
MessageBox.Show("The next non-empty column is " + i.ToString());
Visual BasicCopy Code
Dim styleCold As New FarPoint.Win.Spread.NamedStyle
Dim styleCool As New FarPoint.Win.Spread.NamedStyle
Dim styleMild As New FarPoint.Win.Spread.NamedStyle
Dim styleWarm As New FarPoint.Win.Spread.NamedStyle
Dim styleHot As New FarPoint.Win.Spread.NamedStyle
styleCold.BackColor = Color.Blue
styleCold.ForeColor = Color.White
styleCool.BackColor = Color.Cyan
styleMild.BackColor = Color.Lime
styleWarm.BackColor = Color.Yellow
styleHot.BackColor = Color.Red

FpSpread1.ActiveSheet.Cells(1, 1).Value = 73

If TypeOf FpSpread1.ActiveSheet.Models.Style Is FarPoint.Win.Spread.IConditionalFormatSupport Then

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleCold,
FarPoint.Win.Spread.ComparisonOperator.LessThanOrEqualTo, "40")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleCool,
FarPoint.Win.Spread.ComparisonOperator.Between, "40", "55")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleMild,
FarPoint.Win.Spread.ComparisonOperator.Between, "55", "75")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleWarm,
FarPoint.Win.Spread.ComparisonOperator.Between, "75", "85")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleHot,
FarPoint.Win.Spread.ComparisonOperator.GreaterThan, "85")

End If

Dim i As Integer
i = CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).ConditionalFormatNextNonEmptyColumnInRow(1,
-1)
MessageBox.Show("The next non-empty column is " & i.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.