How prevent render grid?

How can I prevent render grid?

Simple example:

https://blazorplayground.syncfusion.com/VDhfZANoLSRVmcnc

When i select/deselect row in second grid, this is very slowly.

Beacuse (I think so) the first grid is all time re-rendered.


5 Replies 1 reply marked as answer

MS Monisha Saravanan Syncfusion Team March 7, 2024 12:08 PM UTC


Hi Tomasz,


We would like to inform you that it is always recommended to use either paging/virtualization while rendering larger number of records in WASM application for better performance.


In your shared sample you have used EnableToolbarItemsAsync method inside the RowSelectEvent handlers which increases the delay while performing selection.


We have modified the implementation order inside the RowSelect and RowDeselect events and reattached the shared sample, the performance is improved compare to the shared sample. Kindly check the below attached sample and code snippet for your reference.


Sample: https://blazorplayground.syncfusion.com/embed/hXrftgtcJDsxcrmZ?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5


 

        public async Task RowSelectHandler1(RowSelectEventArgs<Order> args)

        {

               DataGrid1.PreventRender();

              await this.DataGrid2.EnableToolbarItemsAsync(new List<string>() { "Edit", "Delete" }, true);

 

            args.PreventRender = true;

         

         

        }

 

        public async Task RowDeselectHandler1(RowDeselectEventArgs<Order> args)

        {

             DataGrid1.PreventRender();

             await this.DataGrid2.EnableToolbarItemsAsync(new List<string>() { "Edit", "Delete" }, false);

 

            args.PreventRender = true;

           

        }

 



Please let us know if you have any concerns.


Regards,

Monisha


Marked as answer

TS Tomasz S. March 11, 2024 11:13 AM UTC

Super.

Changing the order of actions in the method solves the problem.


Thanks.



GE Getsy Edwin Syncfusion Team March 12, 2024 05:33 AM UTC

Hi Tomasz,

Glad that the issue is resolved. Please get back to us if you need any other assistance.

Regards,

Getsy



WI WilliamCBegley April 12, 2024 01:43 PM UTC

I also have a similer question to ask, can I ask it here?



PS Prathap Senthil Syncfusion Team April 15, 2024 09:55 AM UTC

Hi William,

Yes, you can ask your question here. Please share the following details to proceed further. It will be very helpful for us to validate the reported query and provide a solution as soon as possible:

  • Share with us the entire Grid code snippet along with the model class.
  • Share with us a video demonstration of the issue along with replication steps.
  • If possible, share with us a simple reproducible sample with replication steps?


Regards,
Prathap Senthil


Loader.
Up arrow icon