Hi,
" i thought, that the observable collection automaticaly updates the datagrid over the collectionchangedevent" -this is a first confusion
this event will fire in oly one case when you (add, delete .. etc data whithin this collection).
So
MainGrid.ItemsSource = AddressCollection;
doesn't fire the event!!
If you want all this stuff work automatically withot any code like below, you need, to provide MVVM pattern to your Data
for example:
public class MainViewModel
{
private ObservableCollection<address> _addressCollection;
public ObservableCollection<address> AddressCollection
{
get{ return _addressCollection;}
set{ _addressCollection=value; RaiseProperchyChanged("AddressCollection")}
}
}
</address></address>
<datagrid x:name="MainGrid" itemssource="{Binding AddressCollection}" datacontext="{Binding" mode="hold" xmlns:x="#unknown" />