Hi,
The requirement is to select the next row after deletion of a row ,which is triggered due removal of item leading to Items Collection Changed event.
I tried creating custom Grid with the following code and It did not work for me [for simplicity i'm selecting first element in the below code snippet]
//In constructor
Items.CollectionChanged += ItemsOnCollectionChanged;
private void ItemsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
if(args.Action==NotifyCollectionChangedAction.Remove)
SelectedItem = Items[0];
}
The requirement is to select the next row after deletion of a row ,which is triggered due removal of item leading to Items Collection Changed event.
I tried creating custom Grid with the following code and It did not work for me [for simplicity i'm selecting first element in the below code snippet]
//In constructor
Items.CollectionChanged += ItemsOnCollectionChanged;
private void ItemsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
if(args.Action==NotifyCollectionChangedAction.Remove)
SelectedItem = Items[0];
}