Spread for ASP.NET 7.0 Product Documentation
NonEmptyColumnCount Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : NonEmptyColumnCount Property


Glossary Item Box

Gets the number of columns in the model that contain data (bound or unbound).

Syntax

Visual Basic (Declaration) 
Public Overrides ReadOnly Property NonEmptyColumnCount As Integer
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim value As Integer
 
value = instance.NonEmptyColumnCount
C# 
public override int NonEmptyColumnCount {get;}

Property Value

Integer number that is one more than the index of the last column in the model that contains data

Remarks

This property returns a value that is one more than the index of the last column in the model that contains data.

Example

This example assigns values to the Spread data model and returns the number of non-empty columns and rows.
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesMyBase.Load
If(IsPostBack)Then
Return
EndIf

FpSpread1.ActiveSheetView.DataModel.SetValue(0,0,"First")
FpSpread1.ActiveSheetView.DataModel.SetValue(0,1,"Second")
FpSpread1.ActiveSheetView.DataModel.SetValue(0,2,"Third")
FpSpread1.ActiveSheetView.DataModel.SetValue(2,0,"Un")
FpSpread1.ActiveSheetView.DataModel.SetValue(2,1,"Deux")
FpSpread1.ActiveSheetView.DataModel.SetValue(2,2,"Trois")

DimmodelAsFarPoint.Web.Spread.Model.DefaultSheetDataModel=FpSpread1.ActiveSheetView.DataModel
ListBox1.Items.Add(Convert.ToString(model.NonEmptyColumnCount))
ListBox1.Items.Add(Convert.ToString(model.NonEmptyRowCount))
End Sub
C#Copy Code
private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;

FpSpread1.ActiveSheetView.DataModel.SetValue(0,0,"First");
FpSpread1.ActiveSheetView.DataModel.SetValue(0,1,"Second");
FpSpread1.ActiveSheetView.DataModel.SetValue(0,2,"Third");
FpSpread1.ActiveSheetView.DataModel.SetValue(2,0,"Un");
FpSpread1.ActiveSheetView.DataModel.SetValue(2,1,"Deux");
FpSpread1.ActiveSheetView.DataModel.SetValue(2,2,"Trois");

FarPoint.Web.Spread.Model.DefaultSheetDataModelmodel=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
ListBox1.Items.Add(Convert.ToString(model.NonEmptyColumnCount));
ListBox1.Items.Add(Convert.ToString(model.NonEmptyRowCount));
}

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

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