We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using GridEvents RowDataBound causes it to constantly call OnAfterRender

hello,

im using grid (version 20.4.0.38) in blazor server application:

<SfGrid AllowPaging="true" AllowSelection="true" DataSource="@_pdfItems.Values.ToList()" TValue="PdfItem" @ref="@Grid" Toolbar="_toolbaritems">
<GridSelectionSettings AllowDragSelection="true" Type="SelectionType.Multiple" Mode="SelectionMode.Row" CheckboxOnly="false" PersistSelection="true"></GridSelectionSettings>
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
<GridEvents RowDataBound="RowDataBoundHandle" TValue="PdfItem"></GridEvents>
<GridColumns>

and method RowDataBoundHandler for test is empty:

public void RowDataBoundHandle(RowDataBoundEventArgs<PdfItem> args)
{
}


in this case, page/grid in nonstop rendered, nonstop calling onafterrender and grid is refreshing (showing/blinking spinning circle). my log:

2023-02-24 03:47:29.097 [DBG] [127.0.0.1      ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.SetParametersAsync, Parameters: {"$type": "ParameterView"}
2023-02-24 03:47:29.141 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnInitialized
2023-02-24 03:47:29.479 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: True
2023-02-24 03:47:29.546 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: False
2023-02-24 03:47:29.558 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: False
2023-02-24 03:47:29.658 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: False
2023-02-24 03:47:29.675 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: False
2023-02-24 03:47:29.697 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: False
... and continues line with OnAfterRenderAsync



when i remove line with 

<GridEvents RowDataBound="RowDataBoundHandle" TValue="PdfItem"></GridEvents>

everything is ok. mylog:

2023-02-24 03:59:14.499 [DBG] [127.0.0.1      ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.SetParametersAsync, Parameters: {"$type": "ParameterView"}
2023-02-24 03:59:14.543 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnInitialized
2023-02-24 03:59:14.862 [DBG] [127.0.0.1 ] Page: BachConnector.Pages.Convert2PdfA.Files, Method: A21BaseComponent.OnAfterRenderAsync, firstRender: True

and no more onafterrender component.

am i doing something wrong?


8 Replies

BL Balamurugan Lakshmanan Syncfusion Team February 27, 2023 03:15 PM UTC

Hi Jan,


Greeting from Syncfusion Support.


We suspect that you are facing an issue on spinning circle while debugging the RowDataBound method. It is the default behaviour of RowDataBound Event ,because it triggers every time a request is made to access row information, element, or data and also before the row element is appended to the DataGrid element. Kindly refer the UG documentation for your reference.


https://blazor.syncfusion.com/documentation/datagrid/events#rowdatabound


Please get back to us if you have further queries.


Regards,

Bala.



JA Jan February 27, 2023 04:22 PM UTC

hello,

no, this behaviour is not only during debugging, but in runtime also. without RowDataBound event is everything ok. page rendered only once on start. but when i add (emptyRowDataBoundHandle method, run application, then grid start calling render page (not only grid, but whole page) and display(blinking) spinning circle and it is impossible to use grid. application (and  RowDataBoundHandle method) does not change data nor grid (for test im using only static test data) and  RowDataBoundHandle method is empty, does not change anything on grid or data.

here are the images how the grid behaves without event RowDataBound and how it behaves with event RowDataBound (empty)



JA Jan February 27, 2023 04:25 PM UTC

Anime GIF Screenshots


Attachment: Screenshotsanimegif_4b46ea99.zip


BL Balamurugan Lakshmanan Syncfusion Team March 1, 2023 11:34 AM UTC

Hi Jan,


We made a sample with the RowBound Event from that sample we could not able to reproduce the reported issue at our end. Kindly refer the attached solution file for your reference. If the issue still persist ,please share the below requested details for further validation .


    1.Share us the entire Grid code snippet along with model class.

    2.Share more details about your requirement elaborately

    3.If possible kindly share us the issue reproduceable sample. 


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


Regards,

Bala


Attachment: BlazorApp1_4023260.zip


HH Holger Hillebrand March 15, 2023 12:03 PM UTC

Hello!

I can confirm the issues, described by Jan.

Same behaviour in my application.

When using the "RowDataBound" event, a spinner occurs and stays even after processing all rows.

And OnAfterRender is called again and again

The example provided by you is working without any issue.


Do you have further information to handle this error?


Best regards,


Holger



BL Balamurugan Lakshmanan Syncfusion Team March 21, 2023 04:48 AM UTC

Hi Holger,


We could not be able reproduce the reported issue at our end. So please share us the issue reproduceable simple sample for further validation at our end.


Kindly get back to us if you have further queries .


Regards,

Bala.




EP Ethan Pongon May 5, 2023 05:20 PM UTC

Did you ever find a solution to this Jan? I'm getting the same thing.



BL Balamurugan Lakshmanan Syncfusion Team May 8, 2023 09:49 AM UTC

Hi Ethan,


We could not be able reproduce the reported issue at our end.Before proceeding further with your requirement, we need some more clarifications from your end. kindly share the below details to proceed further at our end.


  1. Share us the entire Grid code snippet.
  2. Kindly explain your requirement elaborately for better understanding.
  1. Share us a video demonstration of the issue.
  2. If possible kindly share us a simple issue reproduceable sample .


Above requested details will be very helpful in validating the reported query at our end and provide solution as early as possible.


Regards,

Bala.


Loader.
Live Chat Icon For mobile
Up arrow icon