Hi Sarah,
Thank you for reaching out to Syncfusion support!
We have reviewed your requirement regarding preventing the AcceptDialog method from being called when the delete button is clicked in the SfDialog component. To achieve this, we have updated the delete button to specify the type attribute as "button" to ensure that it does not submit the form and trigger the AcceptDialog method.
Here is the updated code snippet:
<Content> <EditForm Model="objData" OnValidSubmit="AcceptDialog"> <DataAnnotationsValidator /> @foreach (var item in objData.lstData) { <div class="d-flex flex-row"> <InputText class="form-control" @bind-Value="item.Name" /> <button @onclick="()=>DeleteItem(item.Id)" type="button">delete</button> </div> } </EditForm> </Content>
|
By setting the type attribute of the delete button to "button", the AcceptDialog method will not be invoked when the button is clicked, thus addressing your requirement.
We have also provided a sample for your reference, which you can access through the following link: https://blazorplayground.syncfusion.com/rNhftpDrUINeMlUi

If you have any further questions or concerns, please feel free to reach out. We're here to assist you.