Spread WPF Documentation
ColumnCount Property (Worksheet)
Example 


Gets or sets the number of columns in the sheet.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property ColumnCount As System.Integer
'Usage
 
Dim instance As Worksheet
Dim value As System.Integer
 
instance.ColumnCount = value
 
value = instance.ColumnCount
[System.ComponentModel.DefaultValue()]
public System.int ColumnCount {get; set;}

Property Value

The number of columns in the sheet.
Example
This example uses the ColumnCount property.
for (int rowIndex = 0; rowIndex < this.gcSpreadSheet1.ActiveSheet.RowCount; rowIndex++)
            {
                for (int colIndex = 0; colIndex < this.gcSpreadSheet1.ActiveSheet.ColumnCount; colIndex++)
                {
                    this.gcSpreadSheet1.Sheets[0].SetValue(rowIndex, colIndex, rowIndex * 10 + colIndex);
                }
            }
For rowIndex As Integer = 0 To Me.gcSpreadSheet1.ActiveSheet.RowCount - 1
            For colIndex As Integer = 0 To Me.GcSpreadSheet1.ActiveSheet.ColumnCount - 1
                Me.GcSpreadSheet1.Sheets(0).SetValue(rowIndex, colIndex, rowIndex * 10 + colIndex)
            Next
        Next
Requirements

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

See Also

Reference

Worksheet Class
Worksheet Members

 

 


Copyright © GrapeCity, inc. All rights reserved.