SfGrid add button doesn't trigger any event

Hi, I have a problem with the SfGrid component.

I am trying to insert the "add" button in the Toolbar.

I have implemented the edit and delete commands per row.

Editing and deleting a row works correctly, but when I try to add a new row and click on save, no event is triggered.

The event I am trying to trigger is OnActionComplete but for saving while adding a new row it doesn't work (The cancel button does)

This is my code: hastebin - ocatazulaf

And this is my class ContactAgenda: hastebin - qeguteveno

1 Reply

RS Renjith Singh Rajendran Syncfusion Team September 8, 2021 11:25 AM UTC

Hi Lorenzo, 

Greetings from Syncfusion support. 

We suggest you to ensure you to modify your codes inside EditTemplate as like below to overcome the reported problem during saving. We suggest you to ensure to provide proper field values in @bind-Value property of component inside EditTemplate based on the Field value of GridColumn
 
Please refer and modify as like the below highlighted codes, 

 
<GridColumn Field="Type.Description" HeaderText="Tipo"> 
        <EditTemplate> 
                 <SfComboBox TValue="string" TItem="ContactAgendaType" ... @bind-Value="@((context as ContactAgenda).Type.Description)" ...> 
                         <ComboBoxFieldSettings Value="Id" Text="Description"></ComboBoxFieldSettings> 
                 </SfComboBox> 
        </EditTemplate> 
</GridColumn> 
<GridColumn Field="Category.Description" HeaderText="Categoria" ValidationRules="@(new ValidationRules{ Required=true})"> 
        <EditTemplate> 
                 <SfComboBox TValue="string" TItem="ContactAgendaCategory" ... @bind-Value="@((context as ContactAgenda).Category.Description)" ...> 
                         <ComboBoxFieldSettings Value="Id" Text="Description"></ComboBoxFieldSettings> 
                 </SfComboBox> 
        </EditTemplate> 
</GridColumn> 


Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon