RecordPropertyChanged event not firing?

When subscribing to RecordPropertyChanged event it doesn't fire?

it should fire when i change something in my objects? but it doesn't? 

am using version wpf syncfusion 18.1.0.42

Note: i attached a sample project to reproduce the issue.

Attachment: SampleApp_9b8e0f35.zip

1 Reply 1 reply marked as answer

SS Susmitha Sundar Syncfusion Team August 24, 2020 02:57 PM UTC

Hi Joseph, 
 
Thank you for using Syncfusion controls. 
 
You should raise the SfDataGrid.View.RecordPropertyChanged in SfDataGrid.Loaded event. And you need to implement the INotifyPropertyChanged for Model classes. 
 
 
dataGrid.Loaded += DataGrid_Initialized; 
 
private void DataGrid_Initialized(object sender, EventArgs e) 
{ 
    dataGrid.View.RecordPropertyChanged += View_RecordPropertyChanged; 
} 
 
public class OrderLine :INotifyPropertyChanged 
{ 
    private int id; 
    public int ID 
    { 
        get 
        { 
            return id; 
        } 
        set 
        { 
            id = value; 
            OnPropertyChanged("ID");  
        } 
    } 
 
    private Product product; 
    public Product Product 
    { 
        get 
        { 
            return product; 
        } 
        set 
        { 
            product = value; 
            OnPropertyChanged("Product"); 
        } 
    } 
 
    private double quantity; 
    public double Quantity 
    { 
        get 
        { 
            return quantity; 
        } 
        set 
        { 
            quantity = value; 
            OnPropertyChanged("Quantity"); 
        } 
    } 
 
    private decimal amount; 
    public decimal Amount 
    { 
        get 
        { 
            return amount; 
        } 
        set 
        { 
            amount = value; 
            OnPropertyChanged("Amount"); 
        } 
    } 
 
    public event PropertyChangedEventHandler PropertyChanged; 
    public void OnPropertyChanged(string PropertyName) 
    { 
        if (PropertyChanged != null) 
            PropertyChanged(this, new PropertyChangedEventArgs(PropertyName)); 
    } 
} 
 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 


Marked as answer
Loader.
Up arrow icon