Class FormValidator
Inheritance
Namespace: Syncfusion.Blazor.DataForm
Assembly: Syncfusion.Blazor.dll
Syntax
public class FormValidator : OwningComponentBase
Constructors
FormValidator()
Declaration
public FormValidator()
Properties
ChildContent
Gets or sets the content to be rendered within the SfDataForm component.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | A Microsoft.AspNetCore.Components.RenderFragment representing the content to display inside the SfDataForm. The default value is |
Remarks
Use this property to define custom content, templates, or data-bound elements placed inside the SfDataForm. This allows you to extend or customize the layout and features of the data form.
Examples
This example demonstrates how to use ChildContent
to add additional markup to the data form:
<SfDataForm>
<FormValidator>
<DataAnnotationsValidator></DataAnnotationsValidator>
</FormValidator>
</SfDataForm>
Methods
Dispose()
Releases the unmanaged resources used by the FormValidator component and optionally disposes of managed resources.
Declaration
public virtual void Dispose()
Remarks
Calling this method will invoke the Dispose(Boolean) method with true
to ensure that all resources held by the validator, including references to Syncfusion.Blazor.DataForm.FormValidator.Parent and ChildContent, are released properly.
Examples
The following example demonstrates how to explicitly call Dispose() on your FormValidator instance:
FormValidator validator = new FormValidator();
validator.Dispose();
Dispose(Boolean)
Releases the unmanaged resources used by the FormValidator component and optionally disposes managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A |
Remarks
When disposing
is true
, this method releases references to Syncfusion.Blazor.DataForm.FormValidator.Parent and ChildContent, ensuring that no memory leaks occur in the component lifecycle.
Always call Dispose() instead of this overload unless you need to customize disposal behavior.
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |