Skip to content

Commit 910ee60

Browse files
Merge branch 'development' into 983001-DocumentChanges2
2 parents f232ccd + a01a443 commit 910ee60

File tree

225 files changed

+6850
-3909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+6850
-3909
lines changed

Document-Processing-toc.html

Lines changed: 93 additions & 47 deletions
Large diffs are not rendered by default.

Document-Processing/Excel/Spreadsheet/Blazor/cell-range.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,112 @@ The following illustration demonstrates the use of autofill in the Spreadsheet c
102102

103103
![Autofill Illustration](images/autofill.gif)
104104

105+
## Events
106+
107+
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.
108+
109+
### AutofillActionBegin
110+
111+
The `AutofillActionBegin` event is triggered before an autofill operation is performed. This event provides an opportunity to validate the autofill operation and apply restrictions based on custom logic, such as preventing the operation under specific conditions.
112+
113+
**Purpose**
114+
115+
This event is useful for scenarios where autofill behavior needs to be controlled dynamically—such as restricting autofill in specific ranges or preventing autofill based on certain conditions.
116+
117+
**Event Arguments**
118+
119+
The event uses the [AutofillActionBeginEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.AutofillActionBeginEventArgs.html) class, which includes the following properties:
120+
121+
| Event Arguments | Description |
122+
|----------------|-------------|
123+
| FillRange (read-only) | The address of the target range for the autofill operation (e.g., "Sheet1!A2:A5"). |
124+
| DataRange (read-only) | The source data range for the autofill operation (e.g., "Sheet1!A1:A1"). |
125+
| Direction (read-only) | The direction of the autofill operation ("Down", "Right", "Up", or "Left"). |
126+
| Cancel | A boolean value to cancel the autofill operation. |
127+
128+
{% tabs %}
129+
{% highlight razor tabtitle="Index.razor" %}
130+
131+
@using Syncfusion.Blazor.Spreadsheet
132+
133+
<SfSpreadsheet DataSource="DataSourceBytes" AutofillActionBegin="OnAutofillActionBegin">
134+
<SpreadsheetRibbon></SpreadsheetRibbon>
135+
</SfSpreadsheet>
136+
137+
@code {
138+
public byte[] DataSourceBytes { get; set; }
139+
140+
protected override void OnInitialized()
141+
{
142+
string filePath = "wwwroot/Sample.xlsx";
143+
DataSourceBytes = File.ReadAllBytes(filePath);
144+
}
145+
146+
public void OnAutofillActionBegin(AutofillActionBeginEventArgs args)
147+
{
148+
// Prevent autofill for a specific range.
149+
if (args.FillRange == "A1:A10")
150+
{
151+
args.Cancel = true;
152+
}
153+
154+
// Prevent autofill when dragging upward.
155+
if (args.Direction == "Up")
156+
{
157+
args.Cancel = true;
158+
}
159+
}
160+
}
161+
162+
{% endhighlight %}
163+
{% endtabs %}
164+
165+
**AutofillActionEnd**
166+
167+
The `AutofillActionEnd` event is triggered after an autofill operation has been successfully completed. This event provides detailed information about the completed autofill action, enabling further processing or logging if required.
168+
169+
**Purpose**
170+
171+
This event is useful for scenarios where post-autofill actions are needed, such as logging the autofill operation, updating related data, or triggering additional UI updates.
172+
173+
**Event Arguments**
174+
175+
The event uses the [AutofillActionEndEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.AutofillActionEndEventArgs.html) class, which includes the following properties:
176+
177+
| Event Arguments | Description |
178+
|----------------|-------------|
179+
| FillRange (read-only) | The address of the target range where the autofill was applied (e.g., "Sheet1!A2:A5"). |
180+
| DataRange (read-only) | The source data range used for the autofill operation (e.g., "Sheet1!A1:A1"). |
181+
| Direction (read-only) | The direction of the autofill operation ("Down", "Right", "Up", or "Left"). |
182+
183+
{% tabs %}
184+
{% highlight razor tabtitle="Index.razor" %}
185+
186+
@using Syncfusion.Blazor.Spreadsheet
187+
188+
<SfSpreadsheet DataSource="DataSourceBytes" AutofillActionEnd="OnAutofillActionEnd">
189+
<SpreadsheetRibbon></SpreadsheetRibbon>
190+
</SfSpreadsheet>
191+
192+
@code {
193+
public byte[] DataSourceBytes { get; set; }
194+
195+
protected override void OnInitialized()
196+
{
197+
string filePath = "wwwroot/Sample.xlsx";
198+
DataSourceBytes = File.ReadAllBytes(filePath);
199+
}
200+
201+
public void OnAutofillActionEnd(AutofillActionEndEventArgs args)
202+
{
203+
// Log or process the completed autofill operation.
204+
Console.WriteLine($"Autofill completed for range: {args.FillRange}");
205+
}
206+
}
207+
208+
{% endhighlight %}
209+
{% endtabs %}
210+
105211
## Clear
106212

107213
Clear support helps clear the cell contents (formulas and data) and formats (including number formats) in a Spreadsheet. When **Clear All** is applied, both the contents and the formats will be cleared simultaneously.

0 commit comments

Comments
 (0)