Spread WPF Documentation
Background Property (Column)
Example 


Gets or sets the background for a column.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property Background As System.Windows.Media.Brush
'Usage
 
Dim instance As Column
Dim value As System.Windows.Media.Brush
 
instance.Background = value
 
value = instance.Background
[System.ComponentModel.DefaultValue()]
public System.Windows.Media.Brush Background {get; set;}

Property Value

A System.Windows.Media.Brush object that describes the background for cells in this column. The default value is null, which means the background color is not specified and the column inherits the background color from the worksheet.
Example
This example sets the Background property.
for (int i = 0; i < gcSpreadSheet1.Sheets[0].RowCount; i++)
{
    gcSpreadSheet1.Sheets[0].Columns[1].SetValue(i, i);
}
gcSpreadSheet1.Sheets[0].Columns[1].Background = new SolidColorBrush(Colors.Gray);
gcSpreadSheet1.Sheets[0].Columns[1].Foreground = new SolidColorBrush(Colors.Red);
gcSpreadSheet1.Sheets[0].Columns[1].Formatter = new GeneralFormatter("0.00");
gcSpreadSheet1.Sheets[0].Columns[1].FontSize = 12;
gcSpreadSheet1.Sheets[0].Columns[1].FontWeight = FontWeights.Bold;
gcSpreadSheet1.Sheets[0].Columns[1].BorderBottom = new BorderLine(Colors.Green, BorderLineStyle.Thin);
gcSpreadSheet1.Sheets[0].Columns[1].BorderTop = new BorderLine(Colors.Green, BorderLineStyle.Thin);
gcSpreadSheet1.Sheets[0].Columns[1].BorderLeft = new BorderLine(Colors.Green, BorderLineStyle.Thin);
gcSpreadSheet1.Sheets[0].Columns[1].BorderRight = new BorderLine(Colors.Green, BorderLineStyle.Thin);
For i As Integer = 0 To GcSpreadSheet1.Sheets(0).RowCount - 1
    GcSpreadSheet1.Sheets(0).Columns(1).SetValue(i, i)
Next
GcSpreadSheet1.Sheets(0).Columns(1).Background = New SolidColorBrush(Colors.Gray)
GcSpreadSheet1.Sheets(0).Columns(1).Foreground = New SolidColorBrush(Colors.Red)
GcSpreadSheet1.Sheets(0).Columns(1).Formatter = New GeneralFormatter("0.00")
GcSpreadSheet1.Sheets(0).Columns(1).FontSize = 12
GcSpreadSheet1.Sheets(0).Columns(1).FontWeight = FontWeights.Bold
GcSpreadSheet1.Sheets(0).Columns(1).BorderBottom = New BorderLine(Colors.Green, BorderLineStyle.Thin)
GcSpreadSheet1.Sheets(0).Columns(1).BorderTop = New BorderLine(Colors.Green, BorderLineStyle.Thin)
GcSpreadSheet1.Sheets(0).Columns(1).BorderLeft = New BorderLine(Colors.Green, BorderLineStyle.Thin)
GcSpreadSheet1.Sheets(0).Columns(1).BorderRight = New BorderLine(Colors.Green, BorderLineStyle.Thin)
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional (SP4), Windows XP (SP2), Windows 2008, Windows 2003 Server (SP1)

See Also

Reference

Column Class
Column Members

 

 


Copyright © GrapeCity, inc. All rights reserved.