Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
594
What grid event fires when a new item is added to the underlying DataSource?
posted

I have a XamDataGrid bound to an ObservableCollection<Person>. I want to apply an animation to any new items added to the grid and, because I'm usign MVVM and am building the animation purely in XAML, I need to bind the Style trigger to a grid event so simply hooking the ObservableCollection's CollectionChanged event doesn't seem to apply, especially as records may be deleted as well as added.

Parents
No Data
Reply
  • 2426
    posted

    Hello BarraCoder,

    You can use the CollectionChanged event and interrogate the NotifyCollectionChangedEventArgs.Action property to determine whether a new item was added or not.

Children
No Data