Spread for ASP.NET 9.0 Product Documentation
BackColor Property (PreviewRowInfo)
Example 


Gets or sets the background color of the preview row information.
Syntax
'Declaration
 
Public Property BackColor As Color
'Usage
 
Dim instance As PreviewRowInfo
Dim value As Color
 
instance.BackColor = value
 
value = instance.BackColor
public Color BackColor {get; set;}

Property Value

Color object containing the background color
Example
This example customizes the appearance of the preview row.
// Add this style definition inside the STYLE element in the Default.aspx page.
.previewer  
 {  
       border-style:dashed;
     border-color:Green;
     border-width:thick;
     font-family:Arial;
     font-style:italic;
     color:Blue;
     background-color:Yellow;
     text-align:right;
     text-decoration:'underline'|'overline'|'line-through'|'blink';
     vertical-align:bottom;
 } 


// Define the background.
FarPoint.Web.Spread.Background bg = new FarPoint.Web.Spread.Background();
bg.SelectedBackgroundImageUrl = "picture/Winter.jpg";
bg.BackgroundImageUrl = "picture/Image.bmp";
FarPoint.Web.Spread.Border bd1 = new FarPoint.Web.Spread.Border();
bd1.BorderColor = System.Drawing.Color.Blue;
bd1.BorderStyle = System.Web.UI.WebControls.BorderStyle.Dashed;

// Set the preview row properties.
FarPoint.Web.Spread.PreviewRowInfo previewRowInfo = new FarPoint.Web.Spread.PreviewRowInfo();
previewRowInfo.BackColor = Color.Blue;
previewRowInfo.Background = bg;
previewRowInfo.Border = bd1;
previewRowInfo.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
previewRowInfo.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Middle; 
previewRowInfo.TabStop = true;
previewRowInfo.Margin.Bottom = 10;
previewRowInfo.Margin.Left = 10;
previewRowInfo.Margin.Right = 10;
previewRowInfo.Margin.Top = 10;
previewRowInfo.ForeColor = System.Drawing.Color.Green;
previewRowInfo.CssClass = "previewer";    // If set to previewer, other setting have no effect.
previewRowInfo.Font.Bold = true;
previewRowInfo.Font.Italic = true;
previewRowInfo.Font.Overline = true;
previewRowInfo.Font.Size = 20;
previewRowInfo.Font.Underline = true;
previewRowInfo.Font.Strikeout = true;
previewRowInfo.Font.Name = "Verdana";   // Try with some other name of font.
ListBox1.Items.Add(previewRowInfo.IsEmpty.ToString());
ListBox1.Items.Add(previewRowInfo.CanSerializeXml.ToString());

// Use the preview row.
FpSpread1.ActiveSheetView.PreviewRowColumnIndex = 0;
FpSpread1.ActiveSheetView.PreviewRowStyle = previewRowInfo;
FpSpread1.ActiveSheetView.PreviewRowVisible = true;
' Add this style definition inside the STYLE element in the Default.aspx page.
.previewer  
 {  
       border-style:dashed;
     border-color:Green;
     border-width:thick;
     font-family:Arial;
     font-style:italic;
     color:Blue;
     background-color:Yellow;
     text-align:right;
     text-decoration:'underline'|'overline'|'line-through'|'blink';
     vertical-align:bottom;
 } 


' Define the background.
Dim bg As New FarPoint.Web.Spread.Background()
bg.SelectedBackgroundImageUrl = "picture/Winter.jpg"
bg.BackgroundImageUrl = "picture/Image.bmp"
Dim bd1 As New FarPoint.Web.Spread.Border()
bd1.BorderColor = System.Drawing.Color.Blue
bd1.BorderStyle = System.Web.UI.WebControls.BorderStyle.Dashed

' Set the preview row properties.
Dim previewRowInfo As New FarPoint.Web.Spread.PreviewRowInfo()
previewRowInfo.BackColor = Color.Blue
previewRowInfo.Background = bg
previewRowInfo.Border = bd1
previewRowInfo.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center
previewRowInfo.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Middle
previewRowInfo.TabStop = True
previewRowInfo.Margin.Bottom = 10
previewRowInfo.Margin.Left = 10
previewRowInfo.Margin.Right = 10
previewRowInfo.Margin.Top = 10
previewRowInfo.ForeColor = System.Drawing.Color.Green
previewRowInfo.CssClass = "previewer"  ' If set to previewer, other setting have no effect.
previewRowInfo.Font.Bold = True
previewRowInfo.Font.Italic = True
previewRowInfo.Font.Overline = True
previewRowInfo.Font.Size = 20
previewRowInfo.Font.Underline = True
previewRowInfo.Font.Strikeout = True
previewRowInfo.Font.Name = "Verdana"  ' Try with some other name of font.
ListBox1.Items.Add(previewRowInfo.IsEmpty.ToString())
ListBox1.Items.Add(previewRowInfo.CanSerializeXml.ToString())

' Use the preview row.
FpSpread1.ActiveSheetView.PreviewRowColumnIndex = 0
FpSpread1.ActiveSheetView.PreviewRowStyle = previewRowInfo
FpSpread1.ActiveSheetView.PreviewRowVisible = True
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

PreviewRowInfo Class
PreviewRowInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.