Spread Silverlight Documentation
Background Property (TableStyleInfo)
Example 


Gets or sets a System.Windows.Media.Brush object that describes the background for a cell.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property Background As System.Windows.Media.Brush
'Usage
 
Dim instance As TableStyleInfo
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

The System.Windows.Media.Brush object that describes the background for a cell.
Example
This example uses the Background property.
public class lname
        {
            public string last { get; set; }
            public int val { get; set; }
            public lname(string last, int val)
            {
                this.last = last;
                this.val = val;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            lname[] arr = new lname[] { new lname("Smith", 100), new lname("Fender", 3), new lname("Gill", 5), new lname("Johnson", 8) };

            GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo tablestyle = new GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo();
            tablestyle.Background = new SolidColorBrush(Colors.Red);
            tablestyle.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Purple);
            tablestyle.BorderTop = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.DarkGray);
            tablestyle.BorderLeft = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick);
            tablestyle.BorderRight = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick);
            
            GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo tablestylerow = new GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo();
            tablestylerow.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick);
            
            GrapeCity.Windows.SpreadSheet.Data.TableStyle testtable = new GrapeCity.Windows.SpreadSheet.Data.TableStyle();
            testtable.WholeTableStyle = tablestyle;
            testtable.HeaderRowStyle  = tablestylerow; 
                      
            gcSpreadSheet1.Sheets[0].AddTable("Table1", 1, 1, arr, testtable);
           gcSpreadSheet1.Invalidate();
Public Class lname
    Public Property last() As String
        Get
            Return m_last
        End Get
        Set
            m_last = Value
        End Set
    End Property
    Private m_last As String
    Public Property val() As Integer
        Get
            Return m_val
        End Get
        Set
            m_val = Value
        End Set
    End Property
    Private m_val As Integer
    Public Sub New(last As String, val As Integer)
        Me.last = last
        Me.val = val
    End Sub
End Class

Dim arr As lname() = New lname() {New lname("Smith", 100), New lname("Fender", 3), New lname("Gill", 5), new lname("Johnson", 8)}
Dim tablestyle As New GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo()
tablestyle.Background = New SolidColorBrush(Colors.Red)
tablestyle.BorderBottom = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Purple)
tablestyle.BorderTop = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.DarkGray)
tablestyle.BorderLeft = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick)
tablestyle.BorderRight = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick)
            
Dim tablestylerow As New GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo()
tablestylerow.BorderBottom = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick)
            
Dim testtable As New GrapeCity.Windows.SpreadSheet.Data.TableStyle()
testtable.WholeTableStyle = tablestyle
testtable.HeaderRowStyle  = tablestylerow
GcSpreadSheet1.Sheets(0).AddTable("Table1", 1, 1, arr, testtable)
GcSpreadSheet1.Invalidate()
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

TableStyleInfo Class
TableStyleInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.