How To Keep Edit Row from Being Cancelled

Hi,

My issue is that when I create or update a row, if I need to return because of an error, but keep the editing of the row, it does not work. As soon as the method is done, the RowCreate and RowUpdate seem to reset the row I am editing.

I have tried calling EditRow again but it still cancels the edit if its called within those functions. Is there a way to prevent this from happening.

Thanks

Are you are referring some particular demo? Maybe this one?

So after looking at the UpdateRow function for RadzenDataGrid, the issue is that it called a StateHasChanged after awaiting the RowCreate/RowUpdate callback. Is there anyway to avoid this? What if you don't want it to automatically call StateHasChanged because it resets something you are editing? Feels like there should be an option to do this ourselves when we need it rather than it being forced.

I’m afraid that I don’t understand your case. For a complex component like the DataGrid state is changed on various operations.

Let me see if I can simplify, if I am inserting a new item with the RowCreate callback, lets say a function called OnCreateRow. I will send a post request, but I may receive an error that there is a duplicate, in this case I give the user an error, but I want to allow them to keep editing that same row. Currently, I cannot because once the callback function ends, StateHasChanged is called and it resets the grid. Does that make more sense?

Hi, i have the same problem. Did you end up finding a solution to that issue you had?. Thanks in advance.

Hey Mat,

I ended up just changing the editing to a form instead of doing it directly inline. It made things a lot simpler to be honest.