Grid Inline Editing and dynamic data change

Hi,

I would like to be able to handle calculations on fields when adding or editing data inline from a grid.


When adding a record, the calculations are done correctly and I can directly see the results in the other fields. But when editing a record, I can not see the results directly. The results are displayed after the update.


I have attached an example.


When the packaging is changed [Colisage], this produces a change in the quantity [Quantite] and the number of packages [Nb Paquets]. Modifying the quantity [Quantite] manually will cause the number of packages [Nb Paquets] to be recalculated immediatly. And vice versa. All these modifications must lead to modifications on the total weight [Poids total] and the amount [Montant], if the weight [Poids] and the unit price [Prix unitaire] are indicated.

How can I get the same visual result in editing as the one I have in adding ?


Regards,


Fred


Attachment: BlazorAppGridRefresh_f188ef0c.zip


9 Replies 1 reply marked as answer

NP Naveen Palanivel Syncfusion Team May 9, 2022 03:26 PM UTC

Hi Frederic FOURGEOT,


Greetings from Syncfusion.


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


Regards,

Naveen Palanivel.



NP Naveen Palanivel Syncfusion Team May 11, 2022 01:29 PM UTC

Hi Frederic FOURGEOT,


We have further analyzed the reported issue with the provided sample. But we are unable to reproduce the reported issue at our end. We have prepared a video by using your shared sample, please download and refer the video attached in this ticket.


Please check this from your side and if you are still facing difficulties, then we need some more details to further validate the reported issue. So kindly share the following details for better assistance.


  1. Share the video demo showing the replication procedure of issue.


Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.


Regards,

Naveen Palanivel


Attachment: BlazorAppGridRefresh_b0d18997.zip


FF Frederic FOURGEOT May 11, 2022 01:44 PM UTC

Thank you,

It works when you add one and only one line. But add two lines or more, and it's the drama! If I only had one line to add that would be perfect... But this is not the case! And to add a single unique row, I wouldn't have used a datagrid.

Regards

Fred



NP Naveen Palanivel Syncfusion Team May 12, 2022 01:13 PM UTC

Hi Frederic FOURGEOT,


We have further analyzed the reported issue with the provided sample. But we are unable to reproduce the reported issue at our end after adding two or more rows and edit it. We have prepared a video by using your shared sample, please download and refer the video attached in this ticket.


Please check this from your side and if you are still facing difficulties, then kindly share with us a video demo showing the replication procedure of issue to proceed further and provide solution as early as possible.


Regards,

Naveen Palanivel


Attachment: BlazorAppDataGridRefresh_acea0426.zip


FF Frederic FOURGEOT May 12, 2022 02:47 PM UTC

Thank you,


But it's not working for me!




Attachment: BlazorSyncTest_b311be9d.zip


FF Frederic FOURGEOT May 12, 2022 02:52 PM UTC

I've prepared a video attached in this ticket.
Sample is the same for this test.


I would like to understand why it works for you and not for me. With the same code!


Attachment: notworking_for_me_7076ecd.zip



NP Naveen Palanivel Syncfusion Team May 13, 2022 11:48 AM UTC

Hi Frederic FOURGEOT,


We have further analyzed the reported issue with the provided sample and Also we would like to inform you that we have prevented unwanted rendering of Grid component for better performance. Hence the inline edit component is not updated on external value change event. We request you to overcome the behavior by calling PreventRender(false) on value change event as like the below codes.

 

    private void OnColisageChanged(int value)

    {

         MyGrid.PreventRender(false);

        if (Model == null) return;

 

        Model.Colisage = value;

        Events.Add($"Le colisage passe à {value}");

 

        if (Model.Quantite < Model.Colisage)

            Model.Quantite = Model.Colisage;

        else

            Model.Quantite = (int) Math.Ceiling(Model.Quantite / (double)Model.Colisage) * Model.Colisage;

 

        CalculerNbPaquets();

        CalculerTotaux();

    }

 

    private void OnQuantiteChanged(int value)

    {

        Model.Quantite = (int) Math.Ceiling(value / (double)Model.Colisage) * Model.Colisage;

        Events.Add($"La quantité passe à {value}");

        CalculerNbPaquets();

        CalculerTotaux();

    }

 

    private void OnNbPaquetsChanged(int value)


Please get back to us if you need further assistance.


Regards,

Naveen Palanivel.


Marked as answer

FF Frederic FOURGEOT May 13, 2022 01:12 PM UTC

Many thanks!

PreventRender(false) seems to resolve my problem.

Best regards

Fred



MS Monisha Saravanan Syncfusion Team May 16, 2022 04:39 AM UTC

Hi Fred,


Welcome.


We are glad to hear that your issue has been resolved. So we are proceeding to mark this ticket as closed. Kindly get back to us if you have further queries. As always we will be happy to help you.


Regards,

Monisha


Loader.
Up arrow icon