Data saved without save button clicked

Hello, 
I have a grid with commandColumn and customAdapter for CRUD opreations.
The insert/update method are called without clicking on the save button
example:
  • I click on the edit button on row 1
  • row 1 is in edit mode
  • then, I click the edit button on row2
  • the update method is called for row 1 even if I didn'T lcikc on the save button
This should not be happening: I have never clicked on the save button
Is there something I am missing?
Thank you

 
       
           
       
       
       
           
           
           
           
           
               
                   
                       
                   
               
           
           
               
                   
                   
                   
                   
               
           
       
   

22 Replies 1 reply marked as answer

PS psyk March 19, 2021 06:32 PM UTC

here is my grid



VN Vignesh Natarajan Syncfusion Team March 22, 2021 12:19 PM UTC

Hi Audrey,  
 
Thanks for contacting Syncfusion support.  
 
Query: “The insert/update method are called without clicking on the save button This should not be happening: I have never clicked on the save button 
 
We have analyzed the reported query and we understand that you want to save the changes in Grid only on pressing the Save command button click. We have achieved your requirement using OnActionBegin, OnActionComplete and CommandClicked events of the Grid. We have maintained a Boolean variable (IsEdit) to check whether the Grid is in edit state.  
 
In the CommandClicked event based on the Boolean variable we have called CloseEdit() method to cancel the current row editing . Refer the below code example.  
 
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Height="315"> 
    <GridEvents TValue="Order" OnActionBegin="ActionBegin" OnActionComplete="ActionComplete" CommandClicked="CommandClicked"></GridEvents> 
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings> 
    . . . . . . . . 
</SfGrid> 
  
@code{ 
    SfGrid<Order> Grid { getset; } 
    public List<Order> Orders { getset; } 
    //boolean variable to check the edit state  
    public bool isEdit { getset; } 
    public async Task CommandClicked(CommandClickEventArgs<Order> Args) 
    { 
        if (Args.CommandColumn.Type == CommandButtonType.Edit && isEdit) 
        { 
            //to cancel the editing 
            await Grid.CloseEdit(); 
        } 
    } 
    public void ActionComplete(ActionEventArgs<Order> Args) 
    { 
        if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Cancel || Args.RequestType == Syncfusion.Blazor.Grids.Action.Save) 
        {             
            isEdit = false; 
        } 
    } 
    public void ActionBegin(ActionEventArgs<Order> Args) 
    { 
        if(Args.RequestType == Syncfusion.Blazor.Grids.Action.Add || Args.RequestType == Syncfusion.Blazor.Grids.Action.BeginEdit) 
        { 
            isEdit = true; 
        } 
    } 
 
Kindly download the sample from below which we have prepared a sample  
 
 
Refer our UG documentation for your reference    
 
 
Please get back to us if you have further queries.   
 
Regards, 
Vignesh Natarajan  
 


Marked as answer

PS psyk March 22, 2021 12:48 PM UTC

Thank you, I will try this. 
But this feels like a workaround no?
It shouldn't save if i didn't click on the button right?
isn't that a bug?


VN Vignesh Natarajan Syncfusion Team March 23, 2021 06:36 AM UTC

Hi Audrey,  
 
Thanks for the update.  
 
Query: “But this feels like a workaround no? It shouldn't save if i didn't click on the button right? isn't that a bug?” 
 
By design previous edited rows will be autosaved before starting next edit, add or delete operation. We have designed the Blazor Grid feature similar to MS Excel. So modified changes will updated in Grid when row leaves the edit mode. This is default behavior of Grid. But we have considered your requirement (to prevent the autosave) as usability feature and logged the improvement “Need to prevent autosave in Grid on next row edit start column ” for the same.  
 
We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision and technological feasibility. Fix for the improvement will be included in our weekly Nuget release which is expected to be rolled out by month mid of May 2021.  
 
You can also communicate with us regarding the open features any time using our Feature Report page.    
 
 
Till then we suggest you to overcome this behavior by using the solution provided in the previous update. 
 
Regards, 
Vignesh Natarajan  
 



PS psyk March 23, 2021 12:16 PM UTC

Grea,!
Thank you for the update.


VN Vignesh Natarajan Syncfusion Team March 24, 2021 04:29 AM UTC

Hi Audrey, 

Thanks for the update.  

Fix for the issue will be included in our weekly patch release expected to be rolled out by mid of May 2021. Kindly follow our Syncfusion site for release related updates.  

Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan 



VN Vignesh Natarajan Syncfusion Team January 3, 2022 01:29 PM UTC

Hi Audrey,  
 
We would like to inform you that we are unable to include the usability improvement “Need to prevent autosave in Grid on next row edit start” as promised. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest.  
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.          
  
 
We do not have immediate plan to implement this feature and it will be included in any of our upcoming releases. Please cast your vote to make it count. So that we will prioritize the features for every release based on demands and consider the requirement in our Wishlist.  
 
Please let us know if you have any concerns. 
 
Regards, 
Vignesh Natarajan  
 



GP Gerald Peng August 13, 2022 04:38 PM UTC

Hi Syncfusion,


On clicking off of the edited row, is there a way to either (a) guide the user back to the current edited row via pop up ("Hey, please don't click off. Hit save ..."), or (b) (preferred) IGNORE the clicking off of the edited row?

Also - the proposed feature has been in queue for over a year now. Is there an ETA for when it will be implemented? 



Gerald.



NP Naveen Palanivel Syncfusion Team August 15, 2022 12:55 PM UTC

Hi Gerald ,  


Sorry for the Inconvenience.


We are currently Validating  the reported query at our end and we will update the further details within two business days(Aug 17, 2022). Until then we appreciate your patience.


Regards,

Naveen Palanivel



GP Gerald Peng August 15, 2022 02:06 PM UTC

Thanks Naveen.


Just for context - this is an issue with both regular users, and notably, those with accessibility needs. The clicking onto another row is often done by accident during edits when they are navigating the edit row fields. As a result, it is causing issues as they cannot focus on their current record. Thanks Naveen. You guys have a great product and I appreciate the prompt response.


Gerald.



NP Naveen Palanivel Syncfusion Team August 18, 2022 06:49 AM UTC

Hi Gerald,


Thank you for your feedback,


As per the requirement, we prepared a sample. When we click the next row of the edit button without clicking save, the previous edit row and focus do not move to that row. Please refer to the attached sample for your reference.


Please get back to us if you need further assistance.


Regards,

Naveen Palanivel


Attachment: PreventSave_5ad96de6.zip


GP Gerald Peng August 20, 2022 02:35 AM UTC

Hi Naveen


The save of the edited row when you click on another row is still a behavior in your sample. This would be an issue for users without good mouse control and have a tendency to click off of the row being edited. Is there a way to prevent the grid from accepting a click input on another row while there is a row is being edited?


Gerald





NP Naveen Palanivel Syncfusion Team August 23, 2022 03:36 AM UTC

Hi Gerald ,


Sorry for the Inconvenience.


We are currently Validating  the reported query at our end and we will update the further details within two business days(Aug 24, 2022). Until then we appreciate your patience.


Regards,

Naveen Palanivel



NP Naveen Palanivel Syncfusion Team August 24, 2022 06:13 PM UTC

Hi Gerald,


We checked your query and we achieved your requirement when you edit the row after clicking any another row by without cliking save button, it does not go to save state . we prepared sample attached in this ticket . please kindly refer the attached sample for your reference

public async Task CommandClicked(CommandClickEventArgs<Order> Args)

    {

        if (Args.CommandColumn.Type == CommandButtonType.Edit && Grid.IsEdit)

        {

            //prevent default action

            Args.Cancel = true;

            //show your custom dialog here

        }

 

        if (Args.CommandColumn.Type == CommandButtonType.Save && isediting)

        {

            Args.Cancel = false;

            isediting = false;

 

        }

    }

 

    public void ActionBeginHandler(ActionEventArgs<Order> args)

    {

        if(args.RequestType== Syncfusion.Blazor.Grids.Action.Save && isediting )

        {

            args.Cancel = true;

            isediting = false;

        }   

 

      

    }

 

    public void Recordclick(RecordClickEventArgs<Order> args)

    {

        if (Grid.IsEdit)

        {

            isediting = true;

        }

    }


Please get back to us if you need further assistance.



Regards,

Naveen Palanivel


Attachment: PreventSave_c3adfd16.zip


GP Gerald Peng August 24, 2022 09:28 PM UTC

Thanks Naveen - but aside from not saving - will the focus be directed back to the row initially edited, and not the row that was clicked on?



NP Naveen Palanivel Syncfusion Team August 25, 2022 05:24 PM UTC

Hi Gerald,


We checked your query and we would like to inform that it is default behavior when we click is made using mouse.


So that when click is made, focus will be moved to clicked element and focus from edited record will be removed


Please get back to us if you need further assistance.



Regards,

Naveen Palanivel



GP Gerald Peng August 25, 2022 07:53 PM UTC

Hi Naveen,


Is there any way to override the default behavior as you described above?


Gerald.



NP Naveen Palanivel Syncfusion Team August 28, 2022 01:18 PM UTC

Hi Gerald,


We checked your query and we say sorry to inform like that, it is not possible override the default behavior of mouse click action


Please get back to us if you need further assistance on this.



Regards,

Naveen Palanivel



GP Gerald Peng August 29, 2022 05:32 PM UTC

Hi Naveen,


I noticed in this thread, a reference to this feature request:  https://www.syncfusion.com/feedback/23583/need-to-prevent-autosave-in-grid-on-next-row-edit-start  


Any idea when this will be implemented?


Gerald.



KG Keerthana Ganesan Syncfusion Team August 30, 2022 04:08 PM UTC

Hi Gerald,

Welcome from Syncfusion support.

We would like to inform you that we are unable to include the usability improvement “
Need to prevent autosave in Grid on next row edit start” as promised. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest.  

  

You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.          

  

https://www.syncfusion.com/feedback/23583/need-to-prevent-autosave-in-grid-on-next-row-edit-start 


We do not have an immediate plan to implement this feature and it will be included in any of our upcoming releases. Please cast your vote to make it count. So that we will prioritize the features for every release based on demands and consider the requirement in our Wishlist. 


Please let us know if you have any concerns.


Regards,

Keerthana.



GP Gerald Peng September 5, 2022 08:39 PM UTC

Thanks Keerthana.



NP Naveen Palanivel Syncfusion Team September 6, 2022 05:28 PM UTC

Hi Gerald,


Welcome


Please get back to us if you need further assistance.



Regards,

Naveen Palanivel.


Loader.
Up arrow icon