I am using Interaction trigger on RowEditEnded. If the user enter invalid value, I want to remove that row from the Grid. How can I do this ?
ItemsSource="{Binding ItemSource,Mode=TwoWay }"
<i:Interaction.Triggers>
<i:EventTrigger EventName="RowEditEnded">
<cmd:EventToCommand Command="{Binding EditingCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
if (this.ItemSource.Count > 0)
{
var newItem = this.ItemSource.FirstOrDefault(d => d.ItemOrder == null);
if (newItem != null)
{
if (newItem.Id > 0)
{
newItem .ItemOrder = this.ItemSource.Count;
}
else
{
this.ItemSource.Remove(newItem );
}
}
}