Spread WPF Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / Cell Class / ParentStyleName Property
Example


In This Topic
    ParentStyleName Property (Cell)
    In This Topic
    Gets or sets the parent style for a cell.
    Syntax
    'Declaration
     
    <DefaultValueAttribute("")>
    Public Property ParentStyleName As String
    'Usage
     
    Dim instance As Cell
    Dim value As String
     
    instance.ParentStyleName = value
     
    value = instance.ParentStyleName
    [DefaultValue("")]
    public string ParentStyleName {get; set;}

    Property Value

    The parent style for the cell. The default value is an empty string, which means the cell inherits the parent style from the row, column, or worksheet.
    Example
    This example sets the ParentStyleName property.
    gcSpreadSheet1.Sheets[0].NamedStyles.Add(new GrapeCity.Windows.SpreadSheet.Data.StyleInfo() { Background = new SolidColorBrush(Colors.Red), Name = "aaa", VerticalAlignment = GrapeCity.Windows.SpreadSheet.Data.CellVerticalAlignment.Center} );
    gcSpreadSheet1.Sheets[0].NamedStyles.Add(new GrapeCity.Windows.SpreadSheet.Data.StyleInfo() { Background = new SolidColorBrush(Colors.Blue), Name = "ParentStyle", TextIndent = 5});
    gcSpreadSheet1.Sheets[0].Cells[0, 0].StyleName = "aaa";
    gcSpreadSheet1.Sheets[0].Cells[0, 0].ParentStyleName = "ParentStyle";
    gcSpreadSheet1.Invalidate();
    GcSpreadSheet1.Sheets(0).NamedStyles.Add(New GrapeCity.Windows.SpreadSheet.Data.StyleInfo() With {.Background = New SolidColorBrush(Colors.Red), .Name = "aaa", .VerticalAlignment = GrapeCity.Windows.SpreadSheet.Data.CellVerticalAlignment.Center})
    GcSpreadSheet1.Sheets(0).NamedStyles.Add(New GrapeCity.Windows.SpreadSheet.Data.StyleInfo() With {.Background = New SolidColorBrush(Colors.Blue), .Name = "ParentStyle", .TextIndent = 5})
    GcSpreadSheet1.Sheets(0).Cells(0, 0).StyleName = "aaa"
    GcSpreadSheet1.Sheets(0).Cells(0, 0).ParentStyleName = "ParentStyle"
    GcSpreadSheet1.Invalidate()
    See Also