Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 `Disconnected Mode`
- //GetChanges return added rows before update datasource from caching
- var newRows = YourDataTable.GetChanges(DataRowState.Added);
- DataColumn columnFlag = new DataColumn("FlagDelete", typeof(bool));
- 2 `Connected Mode`
- <DataGridTemplateColumn>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <Button Content="Remove" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabControl}}, Path=DataContext.BottomDetailVM.DeleteCommand}" Visibility="{Binding IsNew, Converter={StaticResource Bool2VisibilityConverter}, FallbackValue=Collapsed}" CommandParameter="{Binding}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- public ICommand DeleteRangfolgeCommand
- {
- get
- {
- return new ActionCommand<MyOwnViewModel>(ExecuteDelete);
- }
- }
- private void ExecuteDelete(MyOwnViewModel viewModelToDelete)
- {
- this.ItemsSourceList.Remove(viewModelToDelete);
- }
Add Comment
Please, Sign In to add comment