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

ObservableCollection and INotifyPropertyChanged - does it work for live updates ?

Thread ID:

Created:

Updated:

Platform:

Replies:

150768 Jan 19,2020 10:45 AM UTC Jun 16,2020 12:22 PM UTC Blazor 3
loading
Tags: Grid
Paul Bradbury
Asked On January 19, 2020 10:45 AM UTC

I am looking at the ObservableCollection example for the grid.

I modify the code for an example item in ObservableBinding.razor to be like so below such that every 5 seconds CustomerID is updated triggering INotifyPropertyChanged. The CustomerID on the grid does not update in real-time.

Should it ? Or have I misunderstood ?

Paul.

  public class ObservableDatas : INotifyPropertyChanged
    {
        public ObservableDatas() {

            DoARun();
        }

        async void DoARun()
        {

            try
            {
                CustomerID = DateTime.UtcNow.ToString("yyyyMMddHHmmssFFF");

           }
            catch (Exception ex)
            {

            }

            await Task.Delay(5000);

            Task.Run(() => { DoARun(); });

        }

        public int OrderID { get; set; }
        private string customerID { get; set; }
        public string CustomerID
        {
            get { return customerID; }
            set
            {
                this.customerID = value;
                NotifyPropertyChanged("CustomerID");
            }
        }




Renjith Singh Rajendran [Syncfusion]
Replied On January 20, 2020 02:10 PM UTC

Hi Paul, 

Thanks for contacting Syncfusion support. 

Based on your requirement, we have prepared a sample to perform Live update in Grid. Please download the sample from the link below, 
 
In the above sample, we have bound Observable collection as data to Grid, and updated the cell value with a delay of 100ms, once “Update Data” button is clicked. 
 
Please find the video demo from the link below, 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


paul stanley
Replied On June 15, 2020 05:42 AM UTC

Just to advise the video does not play.

Pavithra Subramaniyam [Syncfusion]
Replied On June 16, 2020 12:22 PM UTC

Hi Paul, 
We have re-attached the video with MP4 format. Please download it from the below link. 
 
 
Regards, 
Pavithra S 


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