Spread Silverlight Documentation
ParentStyleName Property (Cell)
Example 


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()
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

Cell Class
Cell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.