Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / TableStyle Class / FirstHeaderCellStyle Property
Example


In This Topic
    FirstHeaderCellStyle Property
    In This Topic
    The style of the first header cell.
    Syntax
    'Declaration
     
    Public Property FirstHeaderCellStyle As TableStyleInfo
    'Usage
     
    Dim instance As TableStyle
    Dim value As TableStyleInfo
     
    instance.FirstHeaderCellStyle = value
     
    value = instance.FirstHeaderCellStyle
    public TableStyleInfo FirstHeaderCellStyle {get; set;}
    Example
    This example creates a table.
    //Add data
    for (var col = 1; col < 6; col++) {
        for (var row = 2; row < 11; row++) {
            GcSpreadSheet1.Sheets[0].SetValue(row, col, row + col);
        }
    }
    
    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);
    tablestylerow.Background = new SolidColorBrush(Colors.Green);
    
    GrapeCity.Windows.SpreadSheet.Data.TableStyle testtable = new GrapeCity.Windows.SpreadSheet.Data.TableStyle();
    testtable.WholeTableStyle = tablestyle;
    testtable.FirstHeaderCellStyle = tablestylerow;
    testtable.LastHeaderCellStyle = tablestylerow;
    
    var sTable = GcSpreadSheet1.Sheets[0].AddTable("table1", 1, 1, 10, 5, testtable);
    sTable.HighlightFirstColumn = true;
    sTable.HighlightLastColumn = true;
    'Add data
    For col As Integer = 1 To 5
        For row As Integer = 2 To 10
            GcSpreadSheet1.Sheets(0).SetValue(row, col, row + col)
        Next
    Next
    
    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)
    tablestylerow.Background = New SolidColorBrush(Colors.Green)
    
    Dim testtable As New GrapeCity.Windows.SpreadSheet.Data.TableStyle()
    testtable.WholeTableStyle = tablestyle
    testtable.FirstHeaderCellStyle = tablestylerow
    testtable.LastHeaderCellStyle = tablestylerow
    Dim sTable = GcSpreadSheet1.Sheets(0).AddTable("table1", 1, 1, 10, 5, testtable)
    sTable.HighlightFirstColumn = True
    sTable.HighlightLastColumn = True
    See Also