Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / Column Class / FontWeight Property
Example


In This Topic
    FontWeight Property (Column)
    In This Topic
    Gets or sets the font weight for a row.
    Syntax
    'Declaration
     
    <DefaultValueAttribute(System.Windows.FontWeight, "Normal")>
    Public Property FontWeight As FontWeight
    'Usage
     
    Dim instance As Column
    Dim value As FontWeight
     
    instance.FontWeight = value
     
    value = instance.FontWeight
    [DefaultValue(System.Windows.FontWeight, "Normal")]
    public FontWeight FontWeight {get; set;}

    Property Value

    The weight of the font. The default value is Normal.
    Example
    This example sets the FontWeight 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)
    See Also