Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This topic provides a detailed discussion about how to format cells.
It covers formatting cells in GUI mode using the Aspose.Cells.GridWeb control’s Style dialog. It also shows how to format cells programmatically. Different format settings like font, border, and number format are discussed, illustrated with examples.
Cells can be formatted programmatically but the easiest way to format cells in the Aspose.Cells.GridWeb control in a WYSIWYG way is using the Style dialog.
To use the Style dialog: Select a range of cells, then right‑click and select Format Cell.
Selecting Format Cell

The Style dialog is displayed.
The Style dialog is used to format cells

The Style dialog lets users format cells by customizing font and border settings.
You can customize the following font settings using the Style dialog:
You can check the selected font settings in a small preview area.
Customized font settings

The control also allows users to draw a border around cells by customizing border settings in the Style dialog.
To view border‑related options: Click Borders in the Style dialog. Border‑related options are displayed.
Border options in style dialog

The following border options can be selected from the Style dialog:
Customized border settings

Click OK in the Style dialog to apply the changes.
Font and border settings applied

Cells can also be formatted programmatically with the Aspose.Cells.GridWeb API. Each cell has a Style property, which represents a GridTableItemStyle object. Use the Style property to customize font and border settings.
To customize font settings programmatically:
Output: customized font settings shown in A1

Borders can be applied to individual cells, or to a range.
To set the borders of a single cell:
Customized border settings on a single cell

To set borders on a range of cells:
A range of cells with customized border settings

Aspose.Cells.GridWeb supports setting number formats. There are 59 built‑in number formats. To see them, please refer to this list of supported number formats.
All built‑in number formats are in the NumberType enumeration. To use a built‑in number format, set the NumberType using the SetNumberType method of a cell object to a number format from the NumberType enumeration.
To set a custom number format, use the cell’s SetCustom method.
Number format settings applied on B1 and B2

Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.