FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ColumnHeader Class : DefaultStyleName Property |
'Declaration Public Property DefaultStyleName As String
'Usage Dim instance As ColumnHeader Dim value As String instance.DefaultStyleName = value value = instance.DefaultStyleName
public string DefaultStyleName {get; set;}
Exception | Description |
---|---|
System.ArgumentException | Specified style (NamedStyle object) could not be found in the collection |
This example creates a column header and a style for the spreadsheet. The background color in the style is set to yellow, and is then applied to the column header so all the column headers then have a yellow background.
FarPoint.Web.Spread.ColumnHeader colhdr;
FarPoint.Web.Spread.NamedStyle mnstyle = New FarPoint.Web.Spread.NamedStyle();
mnstyle.Name = "fpstyle";
mnstyle.BackColor = Color.Yellow;
FpSpread1.NamedStyles.Add(mnstyle);
colhdr = FpSpread1.ActiveSheetView.ColumnHeader;
colhdr.DefaultStyleName = mnstyle.Name;
Dim colhdr As FarPoint.Web.Spread.ColumnHeader Dim mnstyle As New FarPoint.Web.Spread.NamedStyle() mnstyle.Name = "fpstyle" mnstyle.BackColor = Color.Yellow FpSpread1.NamedStyles.Add(mnstyle) colhdr = FpSpread1.ActiveSheetView.ColumnHeader colhdr.DefaultStyleName = mnstyle.Name
Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional