You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/Blazor/cell-range.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,35 @@ Autofill can be performed in one of the following ways:
25
25
* Drag and drop the cell using the fill handle element.
26
26
* Use the [AutofillAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_AutofillAsync_System_String_System_String_) method programmatically.
27
27
28
+
### Autofill options
29
+
30
+
Autofill supports multiple behaviors that control how adjacent cells are populated when using the fill handle. The available options are:
31
+
32
+
- Copy Cells
33
+
- Fill Series
34
+
- Fill Formatting Only
35
+
- Fill Without Formatting
36
+
37
+
#### Copy Cells
38
+
39
+
Copies the source cell content and formatting to the selected destination range. After dragging the fill handle from the selection to the target area, choose **Copy Cells** from the **AutoFillOption** menu to replicate both values and presentation. When the source contains formulas, relative references are adjusted to match the destination.
40
+
41
+
#### Fill Series
42
+
43
+
Extends a recognizable pattern—such as numbers (1, 2, 3), days or months (Mon, Tue; Jan, Feb), or dates—into the destination range while preserving the source formatting. Drag the fill handle to the target cells and choose **Fill Series** in the **AutoFillOptions** menu to continue the detected sequence.
44
+
45
+
#### Fill Formatting Only
46
+
47
+
Applies only the source styling—number format, font, fill color, borders, and alignment—to the destination range, leaving existing values unchanged. Drag the fill handle over the target cells and select **Fill Formatting Only** from the **AutoFillOptions** menu to unify appearance without altering data.
48
+
49
+
#### Fill Without Formatting
50
+
51
+
Continues the detected series into the destination range but retains the destination’s existing formatting. After dragging the fill handle, choose **Fill Without Formatting** from the **AutoFillOptions** menu to apply only the new values while keeping the target style intact.
52
+
53
+
The following illustration demonstrates the use of autofill in the Spreadsheet component.
54
+
55
+

56
+
28
57
The `AutofillAsync()` method accepts string parameters in A1 notation for `fillRange` and `dataRange`. The available parameters are:
29
58
30
59
| Parameter | Type | Description |
@@ -65,10 +94,6 @@ The `AutofillAsync()` method accepts string parameters in A1 notation for `fillR
65
94
{% endhighlight %}
66
95
{% endtabs %}
67
96
68
-
The following illustration demonstrates the use of autofill in the Spreadsheet component.
69
-
70
-

71
-
72
97
## Events
73
98
74
99
The Blazor Spreadsheet provides events that are triggered during autofill operations, such as [AutofillActionBegin](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.AutofillActionBeginEventArgs.html) and [AutofillActionEnd](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.AutofillActionEndEventArgs.html). These events enable the execution of custom actions before and after an autofill operation, allowing for validation, customization, and response handling.
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/Blazor/formatting.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ Number formats can be applied programmatically to the current selection or a spe
90
90
{% endhighlight %}
91
91
{% endtabs %}
92
92
93
-
> If the built-in formats do not meet specific requirements, custom patterns can be applied programmatically using the `NumberFormatAsync` method. Patterns must be compatible with Excel-style format strings.
93
+
N> If the built-in formats do not meet specific requirements, custom patterns can be applied programmatically using the `NumberFormatAsync` method. Patterns must be compatible with Excel-style format strings.
94
94
95
95
## Text and Cell Formatting
96
96
@@ -178,7 +178,7 @@ Borders can be applied through the UI using the following method:
178
178
179
179
### Applying Borders Programmatically
180
180
181
-
Borders can be applied programmatically to a specific cell or range of cells using the [SetBordersAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SetBordersAsync_Syncfusion_Blazor_Spreadsheet_BorderType_Syncfusion_XlsIO_ExcelLineStyle_System_String_System_String) method. The available parameters in the `SetBordersAsync` method are:
181
+
Borders can be applied programmatically to a specific cell or range of cells using the [SetBordersAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SetBordersAsync_Syncfusion_Blazor_Spreadsheet_BorderType_Syncfusion_XlsIO_ExcelLineStyle_System_String_System_String_) method. The available parameters in the `SetBordersAsync` method are:
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/Blazor/merge-cell.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,11 @@ N> Clicking the **Merge Cells** button (not the drop-down) applies the default a
47
47
48
48
### Merge cells programmatically
49
49
50
-
The [MergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_MergeAsync_System_String_System_String_) method merges cells based on the specified merge type. If the **cellRange** parameter is not provided, the current selection is used. This method provides a programmatic way to merge cells without using the UI. The available parameters in the `MergeAsync` method are:
50
+
The [MergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_MergeAsync_Syncfusion_Blazor_Spreadsheet_MergeType_System_String_) method merges cells based on the specified merge type. If the **cellRange** parameter is not provided, the current selection is used. This method provides a programmatic way to merge cells without using the UI. The available parameters in the `MergeAsync` method are:
51
51
52
52
| Parameter | Type | Description |
53
53
| -- | -- | -- |
54
-
| mergeType |**MergeType**| Specifies the merge behavior.<br><br> the Default MergeType is `MergeType.Cells`. Supported values:<br> -`Cells` - Merge the entire selection into one cell and preserve the top-left value;<br> -`Center`- Merge the entire selection and horizontally center the resulting cell’s content;<br> -`Across` - For each row in the selection, merge the cells across columns and preserve each row’s first cell value. |
54
+
| mergeType |**MergeType**| Specifies the merge behavior.<br><br> The default **MergeType** is `MergeType.Cells`. Supported values:<br> •`Cells` - Merge the entire selection into one cell and preserve the top-left value;<br> •`Center`- Merge the entire selection and horizontally center the resulting cell’s content;<br> •`Across` - For each row in the selection, merge the cells across columns and preserve each row’s first cell value. |
55
55
| cellRange | string (optional) | Specifies the A1-style address of the range to unmerge (e.g., `"A1:D1"`). If not provided, the currently selected range will be unmerged. |
56
56
57
57
{% tabs %}
@@ -112,7 +112,7 @@ The [MergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreads
112
112
113
113
### Unmerge cells programmatically.
114
114
115
-
The [UnmergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_UnmergeAsync_System_String_System_String_) method reverses a merge and restores individual cells. If the **cellRange** parameter is not provided, the current selection cell is unmerged. This method provides a programmatic way to unmerge cells without using the UI. The available parameters in the `UnmergeAsync` method are:
115
+
The [UnmergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_UnmergeAsync_System_String_) method reverses a merge and restores individual cells. If the **cellRange** parameter is not provided, the current selection cell is unmerged. This method provides a programmatic way to unmerge cells without using the UI. The available parameters in the `UnmergeAsync` method are:
116
116
117
117
| Parameter | Type | Description |
118
118
| -- | -- | -- |
@@ -149,7 +149,7 @@ The [UnmergeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Sprea
149
149
{% endhighlight %}
150
150
{% endtabs %}
151
151
152
-
###Limitations of Merge
152
+
## Limitations of Merge
153
153
154
154
When merging cells in the Blazor Spreadsheet, certain constraints apply to ensure data integrity. In these cases, validation messages are displayed:
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/Blazor/worksheet.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,83 @@ This method inserts one or more sheets at a specified position in the workbook w
71
71
{% endhighlight %}
72
72
{% endtabs %}
73
73
74
+
75
+
### Get Active Worksheet Programmatically
76
+
77
+
The [GetActiveWorksheet](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_GetActiveWorksheet) method retrieves properties of the active worksheet. This method is useful when it is necessary to obtain details about the currently active sheet. If no worksheet is active, this method returns null.
78
+
79
+
**Retrieve the active worksheet**
80
+
81
+
This method retrieves details of the currently active worksheet. Properties of the active worksheet, such as sheet name, index, or selected range, can be accessed for diagnostics, automation, or integration with other logic.
82
+
83
+
{% tabs %}
84
+
{% highlight razor %}
85
+
@using Syncfusion.Blazor.Spreadsheet
86
+
87
+
<button @onclick="GetActiveWorksheet">Get Active Worksheet</button>
var active = SpreadsheetInstance.GetActiveWorksheet();
106
+
}
107
+
}
108
+
{% endhighlight %}
109
+
{% endtabs %}
110
+
111
+
### Get Worksheet Data Programmatically
112
+
113
+
The [GetData](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_GetData_System_String_) method retrieves content from the worksheet. This method provides data as a dictionary, where each entry consists of a cell address and its associated `CellData` object. The returned data includes the actual value, number format, display text, wrap and lock status, hyperlinks, and calculated style of each cell in the target area. If the specified cell address is invalid or not set, the method returns null.
114
+
115
+
**Retrieve cell or range data from an active worksheet**
116
+
117
+
Call this method by passing the desired cell or range as the address. For example, provide a reference such as "A1" for a single cell, "A2:B5" for a range, or "Sheet1!A2:B5" to target a range on a specific sheet. The result can be iterated to read individual cell data for further processing, logging, or custom display.
118
+
119
+
| Parameter | Type | Description |
120
+
| :-- | :-- | :-- |
121
+
| cellAddress | string | Specifies the cell or range to read. Supports addresses such as "A1", "A2:B5", or "Sheet1!A2:B5". If omitted or invalid, the return value is null. |
var data = SpreadsheetInstance.GetData("Sheet2!D5:E6");
146
+
}
147
+
}
148
+
{% endhighlight %}
149
+
{% endtabs %}
150
+
74
151
**Insert a single sheet with a user-defined name**
75
152
76
153
This method adds one sheet at a specific position with a user-defined name. Each call to this method adds only one sheet. Using meaningful names like "Budget" or "Inventory" makes the workbook easier to understand. If a negative index value is provided, the method will exit without adding any sheet.
0 commit comments