blazor-devexpress-dot-blazor-dot-richedit-dot-fields-dot-updateallasync-x28-system-dot-boolean-system-dot-threading-dot-cancellationtoken-x29.md
Updates every field in the current sub-document or in all sub-documents.
Namespace : DevExpress.Blazor.RichEdit
Assembly : DevExpress.Blazor.RichEdit.v25.2.dll
NuGet Package : DevExpress.Blazor.RichEdit
public ValueTask UpdateAllAsync(
bool doInAllSubDocuments = false,
CancellationToken cancellationToken = default(CancellationToken)
)
| Name | Type | Default | Description |
|---|---|---|---|
| doInAllSubDocuments | Boolean | False |
true to update fields in all sub-documents; false to update fields in the current sub-document only.
| | cancellationToken | CancellationToken | null |
An object that propagates a cancellation notification.
|
| Type | Description |
|---|---|
| ValueTask |
A structure that stores an awaitable result of an asynchronous operation.
|
Update fields to calculate and display the field results.
The following example shows how you can update every field in all sub-documents:
<DxRichEdit @ref="@richEdit" />
@code {
DxRichEdit richEdit;
Document documentAPI;
@* ... *@
/* Surround the code that contains an asynchronous operation with a try-catch block to handle
the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
try {
documentAPI = richEdit.DocumentAPI;
@* ... *@
await documentAPI.Fields.UpdateAllAsync(true);
@* ... *@
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
The UpdateAsync(Field, CancellationToken) method allows you to update a field.
See Also