Spread ASP.NET 17
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / DefaultSheetStyleModel Class / AltRowCount Property
Example


In This Topic
    AltRowCount Property (DefaultSheetStyleModel)
    In This Topic
    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
    See Also