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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeGrid data not loading after a browser back button click

Thread ID:

Created:

Updated:

Platform:

Replies:

150703 Jan 16,2020 04:31 PM UTC Jan 17,2020 04:09 PM UTC Blazor 1
loading
Tags: TreeGrid
Scott Peal
Asked On January 16, 2020 04:31 PM UTC

I have a TreeGrid populated via an SQL datasource. It displays and works great. When the user clicks a row, I use NavigationManager to redirect the user to the detail page. I am using this approach so the users can bookmark the url with to the detail page with /MyPage/{Id} like url.  

When I click the browser's back button it reloads the data successfully; however, about 1 in 5 times the grid doesn't display the databound rows in the grid UI. I have checked and the TreeData is populated, it is just not showing. 


        protected async void RowSelectHandler(Syncfusion.EJ2.Blazor.Grids.RowSelectEventArgs<Node> Args)
        {
            // Open Page control
            this.SelectedRecords = await this.TreeGrid.GetSelectedRecords();   /// get the selected records
            if (this.SelectedRecords != null && this.SelectedRecords.Count != 0)
            {
                    NavigationManager.NavigateTo("/MyPage/" + this.SelectedRecords[0].Id, false);
            }
        }

        protected override Task OnParametersSetAsync()
        {
            GetData();
            return base.OnParametersSetAsync();
        }

        private async void GetData()
        {
            var dbRecords = await dal.SearchAsync(); /// Call to EF core to get data from database

            foreach (var r in dbRecords)
            {
                Node node = new Node
                {
                    Id = r.Id,
                    ParentId = r.ParentId,
                    Code = r.Code,
                    Name = r.Name
                };
                TreeData.Add(node);
            }

            StateHasChanged();  /// tried this, but still an issue
            base.StateHasChanged(); /// tried this, but still an issue
            this.TreeGrid.Refresh(); /// tried this, but still an issue
        }


Any ideas?

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On January 17, 2020 04:09 PM UTC

Hi Scott, 

Thanks for contacting Syncfusion Support. 

Query#:- When I click the browser's back button it reloads the data successfully; however, about 1 in 5 times the grid doesn't display the databound rows in the grid UI. I have checked and the TreeData is populated, it is just not showing.  

We have prepared sample using your code example but we are unable to reproduce your problem (Grid doesn’t display the rows on browser’s back button at multiple times) at our end.  Refer to the sample Link:- 

Refer to the Video Demo:- 

We need some more additional details to find the cause of the issue. Share us the following details. 
    
  1. Share us the complete TreeGrid code example.
  2. If possible replicate the issue in the above sample and revert us back.
  3. Have you faced the issue on any specific scenario.
  4. Share us the Video demo to replicate the issue.
  5. Can you please bind an actionFailure event to your TreeGrid and share us the args.error stacktrace

Regards, 
Farveen sulthana T 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon