Silverlight list will not update with new source
I have a list linked to a shared list, whenever I removed an item from the shared list and rewrite it into the list, it still shows the deleted items. Here is the code:
InventoryList.Remove(currInv);
lstSubMenu.ItemsSource = InventoryList;
lstSubMenu.DisplayMemberPath = "InventoryItemName";
I have checked the shared list and the item is removed and no error occurs in the output window.
0
a source to share
1 answer
Install ItemsSource = null
before you set it as InventoryList
.
However, it is generally best to set the property ItemsSource
once and never again. You can do this using ObservableCollection
. Once you do that, you can add / remove your heart content and not worry about the binding target not updating.
+2
a source to share