When AllowEditOnDblClick=true - the data bind is different than from "Edit" from toolbar

Hello,

I have found different behaviour in editing mode when using AllowEditOnDblClick = true and click on the "Edit" button in toolbar.

When I click on Edit button in toolbar, everything works fine, but when I double click the row, the data loads well, but after the first binding all other bindings are not displaying.

I found the problem when I was trying to change some data when OnBlur event of NumericTextBox (can be seen on video - first try with Edit from Toolbar is OK, the second one does not show the correct data, but after then saves them well). 

Is there anything I can change to make it work? Where could be the problem? 

I have attached a video of behaviour as well as the code of component

Thanks for help in advance

James



Attachment: 20220408_100552_a4af8ef6.zip

7 Replies 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team April 12, 2022 04:04 AM UTC

Hi Jakub,

Greetings from Syncfusion.


We suspect that you are facing a problem while saving the record after editing. From your shared video, the first time while editing using the toolbar Edit button, actually you don’t save the edited record. Instead of saving the record, you have  cancel the edited data using the Cancel toolbar item. But while editing the row using double click, you have saved the row by clicking the other row. So we are quite unclear about your requirement.


We suspect that the edited data is not saving properly while saving the record. Here, we have prepared a simple sample with local data using the provided code snippets. Please find the below sample.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample1885616886


We need some details regarding your requirement, could you please share the below details which will be helpful to validate and provide a better solution.


  • Whether did you face the problem that the edited data was not saved while saving the record?
  • Whether did you want to update the other column values based on the changed value of the first column?
  • Reproduce the problem in the provided sample and revert back to us with more details.
  • More details about your requirement.


Regards,

Rahul



JP Jakub Prosek April 12, 2022 08:02 AM UTC

Hi Rahul,

thanks for answer, I'll write down some more information.

It's not about saving the data - its about displaying the correct data to the user when OnBlur event is triggered on the first textbox - it loads data from database and fills column "popis" and "stredisko".

But when the edit mode is being opened with double click - it doesn't work. When its opened with command button in toolbar, it works well. It should be the same in both cases - I don't have different behaviour of editing mode just because user doubleClicked instead of clicked on the toolbar.

I've filled the code into your sample and attached a video of the behaviour - it should be in ZIP file in attachment of this reply.

Hope I described everything well :)

Thanks for the help and have a good day

Jakub


Attachment: replySample_15b5cd04.zip


RN Rahul Narayanasamy Syncfusion Team April 13, 2022 03:13 PM UTC

Hi Jakub,


Thanks for sharing the details.


We have analyzed your query with the provided details and we suspect that you are facing an issue when changing a value from a numeric text box. Also, we would like to inform you that we have prevented unwanted rendering of the Grid component during the external action for better performance. Hence the edit component is not updated on the external value change event. We request you to overcome the behavior by calling PreventRender(false) on the value change event.


Kindly refer to the attached code snippet and UG for your reference.


 

    . ..

 

    public void Dopln_popis(Microsoft.AspNetCore.Components.Web.FocusEventArgs args, Prevody radek)

    {

        GridPrevody.PreventRender(false);

        radek.Popis_cz = null;

        if(radek.Inv_cislo == null)

        {

            return;

        }

        else

        {

            //pseudo Loading data from database

            PopisMajetku = LoadFromDB((Int32)radek.Inv_cislo);   

        }

 

 

        foreach (var item in PopisMajetku)

        {

            radek.Popis_cz = item.Popis_cz;

            radek.Stredisko_puvodni = item.Stredisko;

        }

    }


Reference: https://blazor.syncfusion.com/documentation/datagrid/how-to/cascading-dropdownlist-with-grid-editing


Kindly get back to us if you have further queries.


Regards,

Rahul


Marked as answer

JP Jakub Prosek April 19, 2022 07:27 AM UTC

Hi Rahul,

thanks for help, this solution works well.

I have only one more question - why is there a different behaviour when opening edit mode on double click instead of clicking on toolbar? (In this case when opened via toolbar it worked well even without PreventRender(false), as you can see).

Thanks a lot and have a nice work week.

Jakub



RN Rahul Narayanasamy Syncfusion Team April 21, 2022 03:14 AM UTC

Hi Jakub,


Thanks for the update.


We are currently checking the reported case from our end and we will update the further details within three business days. Until then we appreciate your patience.


Regards,

Rahul



JP Jakub Prosek April 26, 2022 06:36 AM UTC

Hi Rahul, is there any with further details? 


Thanks for the info 


Regards,

Jakub



RN Rahul Narayanasamy Syncfusion Team April 27, 2022 02:39 PM UTC

Hi Jakub,


Thanks for your patience and sorry for the delay in getting back to you.


We have checked the mentioned case further from our end. We would like to inform you that for some performance reasons we have prevented the rendering of components during the external actions(while double click to edit the record). Hence the value is not updated when changing the value of the Numeric textbox component. We suggest you to overcome the reported query by calling a PreventRender method of Grid with the false argument as like we have mentioned in the previous update.


Please let us know if you have any concerns.


Regards,

Rahul


Loader.
Up arrow icon