Hi Michele,
Greetings from Syncfusion support.
We have validated your query “How could I trigger the click event on Save or Cancel button? Is it possible?”
Yes, the click event can be triggered for the Save and the Cancel button in the In-Place Editor. This can be done by binding the ‘OnClick’ event for the ‘InPlaceEditorSaveButton’ and the ‘InPlaceEditorCancelButton’. We have prepared a sample for your reference.
Code Snippet:
|
<SfInPlaceEditor @bind-Value="@TextValue" TValue="string">
<EditorComponent>
<SfTextBox @bind-Value="@TextValue" Placeholder="Enter employee name"></SfTextBox>
</EditorComponent>
<InPlaceEditorSaveButton Content="OK" CssClass="e-outline" OnClick="@SaveEvent"></InPlaceEditorSaveButton>
<InPlaceEditorCancelButton Content="Cancel" CssClass="e-outline" OnClick="@CancelEvent"></InPlaceEditorCancelButton>
</SfInPlaceEditor>
@code {
public string TextValue = "Andrew";
public void SaveEvent()
{
// The save button is clicked
}
public void CancelEvent()
{
// The cancel button is clicked
}
} |
Please check the above code snippet and the sample and let us know if it satisfies your requirement.
Regards,
Revanth