Spread ASP.NET 17
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / SheetView Class / StyleModel Property
Example


In This Topic
    StyleModel Property
    In This Topic
    Gets or sets the cell types and other style settings for the sheet.
    Syntax
    'Declaration
     
    
    Public Property StyleModel As ISheetStyleModel
    'Usage
     
    
    Dim instance As SheetView
    Dim value As ISheetStyleModel
     
    instance.StyleModel = value
     
    value = instance.StyleModel
    public ISheetStyleModel StyleModel {get; set;}

    Property Value

    ISheetStyleModel object containing the cell types and other style settings
    Remarks
    This property is available at run time only.
    Example
    The following example creates a sheet with 1000 rows and 7 columns. Alternate rows display a light cyan backcolor, and navy blue, bold text. The fifth row (0 index) is the starting row in the sheet.
    FarPoint.Web.Spread.SheetView sv=FpSpread1.ActiveSheetView;
    FarPoint.Web.Spread.StyleInfo altrowstyle=new FarPoint.Web.Spread.StyleInfo();
    FarPoint.Web.Spread.Model.DefaultSheetStyleModel altrowmodel=new FarPoint.Web.Spread.Model.DefaultSheetStyleModel(1000,7);
    sv.ColumnCount=7;
    sv.RowCount=1000;
    altrowstyle.BackColor=Color.LightCyan;
    altrowstyle.ForeColor=Color.Navy;
    altrowstyle.Font.Bold=true;
    altrowmodel.SetDirectAltRowInfo(1,altrowstyle);
    sv.StyleModel=altrowmodel;
    sv.TopRow=4;
    Dim sv As FarPoint.Web.Spread.SheetView
    Dim altrowstyle As New FarPoint.Web.Spread.StyleInfo()
    Dim altrowmodel As New FarPoint.Web.Spread.Model.DefaultSheetStyleModel(1000,7)
    sv=FpSpread1.ActiveSheetView
    sv.ColumnCount=7
    sv.RowCount=1000
    altrowstyle.BackColor=Color.LightCyan
    altrowstyle.ForeColor=Color.Navy
    altrowstyle.Font.Bold=True
    altrowmodel.SetDirectAltRowInfo(1,altrowstyle)
    sv.StyleModel=altrowmodel
    sv.TopRow=4
    See Also