Spread for ASP.NET 9.0 Product Documentation
AltRowCount Property (DefaultSheetStyleModel)
Example 


Gets or sets the number of alternating rows in the style model.
Syntax
'Declaration
 
Public Overrides Property AltRowCount As Integer
'Usage
 
Dim instance As DefaultSheetStyleModel
Dim value As Integer
 
instance.AltRowCount = value
 
value = instance.AltRowCount
public override int AltRowCount {get; set;}

Property Value

Integer number of alternating rows
Example
This example sets the AltRowCount of the DefaultSheetStyleModel and sets the alternating row styles. The value of the AltRowCount property is returned to a list box.
private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;

FarPoint.Web.Spread.Model.DefaultSheetStyleModel model=(FarPoint.Web.Spread.Model.DefaultSheetStyleModel)FpSpread1.Sheets[0].StyleModel;
FarPoint.Web.Spread.StyleInfo style=new FarPoint.Web.Spread.StyleInfo();
model.AltRowCount=3;

style.BackColor=Color.Yellow;
model.SetDirectAltRowInfo(0,style);

style.Reset();
style.BackColor=Color.Blue;
model.SetDirectAltRowInfo(1,style);

style.Reset();
style.BackColor=Color.Red;
model.SetDirectAltRowInfo(2,style);

ListBox1.Items.Add(model.AltRowCount.ToString());
}
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(IsPostBack)Then Return

Dim model As FarPoint.Web.Spread.Model.DefaultSheetStyleModel=FpSpread1.Sheets(0).StyleModel
model.AltRowCount=3

Dim style As New FarPoint.Web.Spread.StyleInfo()
style.BackColor=Color.Yellow
model.SetDirectAltRowInfo(0,style)

style.Reset()
style.BackColor=Color.Blue
model.SetDirectAltRowInfo(1,style)

style.Reset()
style.BackColor=Color.Red
model.SetDirectAltRowInfo(2,style)

ListBox1.Items.Add(model.AltRowCount.ToString())
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

DefaultSheetStyleModel Class
DefaultSheetStyleModel Members
GetDirectAltRowInfo Method
GetDirectAltRowName Method
SetDirectAltRowInfo Method

 

 


Copyright © GrapeCity, inc. All rights reserved.