Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Remove ListCollectionView items does not update UI

$
0
0

Hello guys,

    I have a Datagrid.ItemsSource binded with a ListCollectionView obtained from an objectquery from EF.

    It work's fine, but, when i Add a new items and "undo" (before save) the items still shows on the datagrid.

    The "undo" i do is listCollectionInstance.Remove(theNewItem).

    I've tried to mark it's state as detached or unchanged or something like that but it still shows on the datagrid.

    I've tried also to listCollectionInstance.Refresh() and it does nothing.

    I could and it works, reload all the collection again from the database, but depending on the size of the collection (4k lines* 15 columns) the reload can take a while because i'm accessing a remote datacenter. When i say "a while" i mean it is not acceptable to wait that time to undo something that never went to the server.

   What i really want is to undo the "add new item" before i had even saved it and that that action reflect itself in the datagrid.

many thanks.

    


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>