Skip to content

857401: Added the form field shading in form field file #6368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: hotfix/hotfix-v30.1.37
Choose a base branch
from
Open
41 changes: 41 additions & 0 deletions blazor/document-editor/form-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,47 @@ All the form fields names form current document can be retrieved using [`GetForm
Task<List<string>> formFieldsNames = await container.DocumentEditor.GetFormFieldNamesAsync();
```

## Form Field Shading

You can customize form field shading at the application level using the [`formFieldSettings`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.FormFieldSettingsModel.html#Syncfusion_Blazor_DocumentEditor_FormFieldSettingsModel_SelectionColor_Syncfusion_Blazor_DocumentEditor_FormFieldSettings_) property.

The example code below demonstrates how to set a custom shading color and how to disable shading (by default, shading is enabled).

```csharp
// Set a custom shading color (for example, white)
@page "/"
@using Syncfusion.Blazor.DocumentEditor
@inject IJSRuntime JS
<SfDocumentEditorContainer @ref="container" EnableToolbar="true" DocumentEditorSettings="Settings" Height="590px">
</SfDocumentEditorContainer>

@code {
private SfDocumentEditorContainer container;
private DocumentEditorSettingsModel Settings = new DocumentEditorSettingsModel()
{
FormFieldSettings = new FormFieldSettingsModel() { ShadingColor = "#ffffff" }
};
}

// Disable form field shading entirely
@page "/"
@using Syncfusion.Blazor.DocumentEditor
@inject IJSRuntime JS
<SfDocumentEditorContainer @ref="container" EnableToolbar="true" DocumentEditorSettings="Settings" Height="590px">
</SfDocumentEditorContainer>

@code {
private SfDocumentEditorContainer container;
private DocumentEditorSettingsModel Settings = new DocumentEditorSettingsModel()
{
FormFieldSettings = new FormFieldSettingsModel() { ApplyShading = false }
};
}

```

N> This customization only affects the application UI and will not be preserved when exporting the document.

## Export form field data

Data of the all the Form fields in the document can be exported using [`ExportFormDataAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html#Syncfusion_Blazor_DocumentEditor_SfDocumentEditor_ExportFormDataAsync).
Expand Down