Trigger Confirm/Cancel click

Hi,
How could I trigger the click event  on Save or Cancel button ?
Is it possible ?

thanks in advance, Michele


3 Replies 1 reply marked as answer

RK Revanth Krishnan Syncfusion Team February 22, 2021 06:42 AM UTC

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 


Marked as answer

MS Michele Semprini February 22, 2021 08:20 AM UTC

Thanks a lot, michele


RK Revanth Krishnan Syncfusion Team February 23, 2021 03:30 AM UTC

Hi Michele, 
 
Thanks for the update. 
 
We are glad that the provided solution satisfies your requirement, please let us know if you need any further assistance. 
 
Regards, 
Revanth 


Loader.
Up arrow icon