DataGrid does not updated when the items source changes

Goodmorning,

I have Sfdatagrid with ItemsSource="{Binding Projects}" in view. In viewModel i have 

public ObservableCollection<Project> Projects { get; set; }.
When I remove one element from Projects (Projects.Remove(Project)) in viewmodel the SFDatagrid refrash the table but if I Add or change one element of the ObservableCollection SfDataGrid does not refrash the table.
I try to replace SFDataGrid with <CollectionView ItemsSource="{Binding Projects}"> with the same ViewModel and the adding work correctly.

Thanks. Best regards.

Roberto



3 Replies

SD Sethupathy Devarajan Syncfusion Team January 20, 2025 11:23 AM UTC

Hi Roberto,


We have tested this scenario using the attached sample, and it worked correctly without any issues. If you are still encountering the same problem, we kindly request you to modify the attached sample to reproduce the issue and provide additional details.  This will greatly assist us in investigating the issue further and providing an appropriate solution as quickly as possible.


Regards,

Sethupathy d.


Attachment: SfDataGridSample_d788cea9.zip


RB Roberto Becchetti January 21, 2025 09:45 PM UTC

Thanks for reply and exemple.

I made a mistake. Sorry.

Best regards.

Roberto



SD Sethupathy Devarajan Syncfusion Team January 22, 2025 10:36 AM UTC

Hi Roberto,

 

No problem at all. Please let us know if you have any further queries on this. We are happy to help.


Regards,

Sethupathy D.


Loader.
Up arrow icon