officefileapi-devexpress-dot-spreadsheet-dot-cellrange-dot-endupdateformatting-x28-devexpress-dot-spreadsheet-dot-formatting-x29.md
Finalizes the modification of the cell range formatting after calling the CellRange.BeginUpdateFormatting method.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
void EndUpdateFormatting(
Formatting newFormatting
)
Sub EndUpdateFormatting(
newFormatting As Formatting
)
| Name | Type | Description |
|---|---|---|
| newFormatting | Formatting |
A Formatting object representing the cell range formatting.
|
This example demonstrates how to format cells in a worksheet.
CellRange.EndUpdateFormatting paired methods.// 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);
' Access the cell to be formatted.
Dim cell As 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.
Dim range As CellRange = worksheet.Range("C3:E6")
' Begin updating of the range formatting.
Dim rangeFormatting As Formatting = 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 EndUpdateFormatting(Formatting) 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.
rangeFormatting.Fill.PatternColor = Color.Violet;
range.EndUpdateFormatting(rangeFormatting);
#endregion #ColorCells
asp-net-mvc-spreadsheet-modify-document/CS/DXWebApplication1/Controllers/HomeController.cs#L38
rangeFormatting.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
priceRange.EndUpdateFormatting(rangeFormatting);
break;
{
range.EndUpdateFormatting(formatting);
}
rangeFormatting.Fill.BackgroundColor = Color.LightBlue;
range.EndUpdateFormatting(rangeFormatting);
#endregion #ColorCells
rangeFormatting.Fill.PatternColor = Color.Violet;
range.EndUpdateFormatting(rangeFormatting);
#endregion #ColorCells
' Finalize to update the cell range formatting.
range.EndUpdateFormatting(rangeFormatting)
#End Region ' #RangeFormatting
winforms-dashboard-customize-exported-document/VB/CustomExportDocumentExample/Form1.vb#L55
formatting.Fill.BackgroundColor = Color.LightBlue
textCell.EndUpdateFormatting(formatting)
textCell.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center
rangeFormatting.Fill.PatternColor = Color.Violet
range.EndUpdateFormatting(rangeFormatting)
' #End Region ' #ColorCells
asp-net-mvc-spreadsheet-modify-document/VB/DXWebApplication1/Controllers/HomeController.vb#L30
rangeFormatting.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center
priceRange.EndUpdateFormatting(rangeFormatting)
Case "insertLink"
rangeFormatting.Fill.BackgroundColor = Color.LightBlue
range.EndUpdateFormatting(rangeFormatting)
' #End Region ' #ColorCells
See Also