Spread WPF Documentation
ParentStyleName Property (Cell)
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Cell Class : ParentStyleName Property
Gets or sets the parent style for a cell.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property ParentStyleName As System.String
'Usage
 
Dim instance As Cell
Dim value As System.String
 
instance.ParentStyleName = value
 
value = instance.ParentStyleName
[System.ComponentModel.DefaultValue()]
public System.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

Reference

Cell Class
Cell Members