private ObservableCollection<OrganizationUnit> _Organizations = new ObservableCollection<OrganizationUnit>();
private ObservableCollection<OrganizationUnit> _OrganizationManagement;
_OrganizationManagement = new ObservableCollection<OrganizationUnit>(_Organizations.Where(p => p.Type == "DealerGroup").ToList());
GridOrganizationManagement.ItemsSource = _OrganizationManagement;
I have main list _Organizations I want that _OrganizationManagement contains filter list of “DealerGroup”.
But problem is using above _Organizations and _OrganizationManagement are not sync when after this code I add value in _Organizations it doesnot add in _OrganizationManagement what i have understand we are filtering it with new ObservableCollection so new instance is pass to _OrganizationManagement
You’ll have to subscribe to the CollectionChanged event of _Organizations and refresh _OrganizationManagement. To preserve the bindings use something like this: