Class InPlaceEditorTemplate
Represents a template for rendering custom components within the Syncfusion.Blazor.InPlaceEditor during edit mode. It allows for the integration of custom UI elements, such as Blazor native textboxes or HTML select elements.
Inheritance
Namespace: Syncfusion.Blazor.InPlaceEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class InPlaceEditorTemplate : OwningComponentBase
Remarks
The InPlaceEditorTemplate
is used to define the editor's appearance and behavior when activated. It is a child component of the Syncfusion.Blazor.InPlaceEditor and provides the ChildContent for custom rendering.
Examples
The following example demonstrates how to use the InPlaceEditorTemplate
with a SfTextBox.
<SfInPlaceEditor TValue="string" Mode="RenderMode.Inline">
<InPlaceEditorTemplate>
<SfTextBox Value="@("Enter your text")"></SfTextBox>
</InPlaceEditorTemplate>
</SfInPlaceEditor>
Constructors
InPlaceEditorTemplate()
Declaration
public InPlaceEditorTemplate()
Properties
ChildContent
Gets or sets the content to be rendered inside the editor template.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | A Microsoft.AspNetCore.Components.RenderFragment that defines the UI elements to be displayed when the In-Place Editor is in edit mode. The default value is |
Remarks
This property allows you to specify custom components, such as a SfTextBox or other input controls, that will appear for editing.
Methods
Dispose()
Releases the unmanaged resources used by the InPlaceEditorTemplate.
Declaration
public virtual void Dispose()
Remarks
This method calls the virtual Dispose(Boolean) method to perform the actual cleanup.
Dispose(Boolean)
Releases the unmanaged resources used by the InPlaceEditorTemplate and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A System.Boolean value that indicates whether the method call comes from a System.IDisposable.Dispose method (if |
Remarks
When disposing
is true
, this method releases all managed resources by setting the Parent
and ChildContent
references to null
.
OnInitializedAsync()
A protected method that is invoked when the component is initialized.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
Remarks
This method registers the template with its parent Syncfusion.Blazor.InPlaceEditor component by calling Syncfusion.Blazor.InPlaceEditor.Internal.IInPlaceEditor.UpdateTemplate(Syncfusion.Blazor.InPlaceEditor.InPlaceEditorTemplate).