Spread Windows Forms 7.0 Product Documentation
ColumnCount Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > SheetStyleModelEventArgs Class : ColumnCount Property

Glossary Item Box

Gets the number of columns, or -1 if all columns were affected.


Visual Basic (Declaration) 
Public ReadOnly Property ColumnCount As Integer
Visual Basic (Usage)Copy Code
Dim instance As SheetStyleModelEventArgs
Dim value As Integer
value = instance.ColumnCount
public int ColumnCount {get;}

Property Value

Integer number of columns affected


This example returns the number of columns affected, in this case a -1 since all the columns were affected.
C#Copy Code
FarPoint.Win.Spread.Model.BaseSheetStyleModel model;

model = (FarPoint.Win.Spread.Model.BaseSheetStyleModel)fpSpread1.ActiveSheet.Models.Style;

model.Changed += new FarPoint.Win.Spread.Model.SheetStyleModelEventHandler(model_StyleModelChanged);
private void button1_Click(object sender, System.EventArgs e)
    FarPoint.Win.Spread.StyleInfo sInfo = new FarPoint.Win.Spread.StyleInfo();
    sInfo.BackColor = Color.Teal;
    model.AltRowCount = 2;
    model.SetDirectAltRowInfo(0, sInfo);

private void model_StyleModelChanged(object sender, FarPoint.Win.Spread.Model.SheetStyleModelEventArgs e)
    textBox1.Text = e.ColumnCount.ToString();
Visual BasicCopy Code
Friend WithEvents model As FarPoint.Win.Spread.Model.BaseSheetStyleModel

model = FpSpread1.ActiveSheet.Models.Style

Dim h As FarPoint.Win.Spread.Model.SheetStyleModelEventHandler = AddressOf model_StyleModelChanged
AddHandler model.Changed, h

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim sInfo As New FarPoint.Win.Spread.StyleInfo
    sInfo.BackColor = Color.Teal
    model.AltRowCount = 2
    model.SetDirectAltRowInfo(0, sInfo)
End Sub

Private Sub model_StyleModelChanged(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.Model.SheetStyleModelEventArgs)
    TextBox1.Text = e.ColumnCount.ToString()
End Sub


Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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