Skip to main content
All docs
V25.1
  • Row

    DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    CellRange.BeginUpdateFormatting() Method

    Starts modifying the cell range formatting.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    #Declaration

    Formatting BeginUpdateFormatting()

    #Returns

    Type Description
    Formatting

    A Formatting object representing the cell range formatting.

    #Example

    This example demonstrates how to format cells in a worksheet.

    View Example

    // Access the cell to be formatted.
    Cell cell = worksheet.Cells["B2"];
    
    // Specify font settings (font name, color, size and style).
    cell.Font.Name = "MV Boli";
    cell.Font.Color = Color.Blue;
    cell.Font.Size = 14;
    cell.Font.FontStyle = SpreadsheetFontStyle.Bold;
    
    // Specify cell background color.
    cell.Fill.BackgroundColor = Color.LightSkyBlue;
    
    // Specify text alignment in the cell. 
    cell.Alignment.Vertical = SpreadsheetVerticalAlignment.Center;
    cell.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
    // Access the range of cells to be formatted.
    CellRange range = worksheet.Range["C3:E6"];
    
    // Begin updating of the range formatting. 
    Formatting rangeFormatting = range.BeginUpdateFormatting();
    
    // Specify font settings (font name, color, size and style).
    rangeFormatting.Font.Name = "MV Boli";
    rangeFormatting.Font.Color = Color.Blue;
    rangeFormatting.Font.Size = 14;
    rangeFormatting.Font.FontStyle = SpreadsheetFontStyle.Bold;
    
    // Specify cell background color.
    rangeFormatting.Fill.BackgroundColor = Color.LightSkyBlue;
    
    // Specify text alignment in cells.
    rangeFormatting.Alignment.Vertical = SpreadsheetVerticalAlignment.Center;
    rangeFormatting.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
    
    // End updating of the range formatting.
    range.EndUpdateFormatting(rangeFormatting);
    

    The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdateFormatting() method.

    Note

    The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

    See Also