[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IDisplayFormat.Style

Style Property

Style

Gets the IStyle object associated with the range.

The returned style is the range's underlying style object. Display-only changes introduced by conditional formatting or table styles are not merged into this style object. To read values as they are currently displayed in the user interface, use other IDisplayFormat members such as NumberFormat, Font, or Borders.

Declaration
IStyle Style { get; }
ReadOnly Property Style As IStyle
Examples
IStyle currencyStyle = workbook.Styles.Add("CurrencyStyle");
currencyStyle.NumberFormat = "$#,##0.00";
IRange range = worksheet.Range["A1"];
range.Value = 1234.56;
range.Style = currencyStyle;
IFormatCondition condition = (IFormatCondition) range.FormatConditions.Add(
    FormatConditionType.CellValue, FormatConditionOperator.Greater, "1000", null);
condition.Interior.Color = Color.Yellow;
condition.NumberFormat = "0.00%";
IStyle style = range.DisplayFormat.Style;
string baseNumberFormat = style.NumberFormat;
string displayedNumberFormat = range.DisplayFormat.NumberFormat;