Spread ASP.NET 14
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / Row Class / Background Property
Example


In This Topic
    Background Property (Row)
    In This Topic
    Gets or sets the background for cells in this row.
    Syntax
    'Declaration
     
    Public Property Background As Background
    'Usage
     
    Dim instance As Row
    Dim value As Background
     
    instance.Background = value
     
    value = instance.Background
    public Background Background {get; set;}

    Property Value

    Background
    Example
    This example sets the background of all the cells in a row.
    FarPoint.Web.Spread.Background bg = new FarPoint.Web.Spread.Background();
    bg.SelectedBackgroundImageUrl = "picture/Winter.jpg";
    bg.BackgroundImageUrl = "picture/Image.bmp";
    bg.Enable = true;
    bg.BackgroundAttachment = "fixed";// inherit, scroll.
    bg.BackgroundPosition = "50% 50%";
    bg.BackgroundRepeat = "repeat-x";
    
    FpSpread1.ActiveSheetView.ColumnCount = 10;
    FpSpread1.ActiveSheetView.PageSize = 20;
    FpSpread1.ActiveSheetView.RowCount = 20;
    FarPoint.Web.Spread.Row myrow;
    int i;
    for (i = 0; i < FpSpread1.ActiveSheetView.RowCount; i++)
    {
        FpSpread1.ActiveSheetView.SetValue(i, 1, "Row Test");
        myrow = FpSpread1.ActiveSheetView.Rows[i];
        myrow.Background=bg;    
        myrow.Height = 70;
    } 
    Dim bg As FarPoint.Web.Spread.Background = New FarPoint.Web.Spread.Background
    bg.SelectedBackgroundImageUrl = "picture/Winter.jpg"
    bg.BackgroundImageUrl = "picture/Image.bmp"
    bg.Enable = true
    bg.BackgroundAttachment = "fixed"  ' inherit, scroll.
    bg.BackgroundPosition = "50% 50%"
    bg.BackgroundRepeat = "repeat-x"
    
    FpSpread1.ActiveSheetView.ColumnCount = 10
    FpSpread1.ActiveSheetView.PageSize = 20
    FpSpread1.ActiveSheetView.RowCount = 20
    Dim myrow As FarPoint.Web.Spread.Row
    Dim i As Integer
    i = 0
    Do While (i < FpSpread1.ActiveSheetView.RowCount)
        FpSpread1.ActiveSheetView.SetValue(i, 1, "Row Test")
        myrow = FpSpread1.ActiveSheetView.Rows(i)
        myrow.Background = bg
        myrow.Height = 70
        i = (i + 1)
    Loop
    See Also