Update single object in ObjectListView

I am using ObjectListView . And use the RefreshObject () method to update only the changed object.

// The difference between associations and updatedAssociations is only in // one item, which ID field remains the same. // So i find an updated item by ID in the associations (before updating). //And say Object ListView to to refresh this item. var associationToUpdate = associations.References.Where( x => x.ID == associationIDToUpdate).FirstOrDefault(); olvAssociations.RefreshObject(associationToUpdate); // And only after this set the model to updated model associations = updatedAssociations; 

But nothing happens. Does anyone know what the matter is?

+4
source share
2 answers

olv suits me too. I understand that you are updating your model outside of objectlistview? the function you are updating means forcing the model to be updated from changes made in the object list itself.

If you update the model outside of the view, the objectlistview says that it automatically refreshes the screen. this statement is a truth not relevant to me, but I am still studying. I will update here if I find a good resolution.

objectlistview, interesting feature - search "After update"

edit:

I have not found an answer that works for me yet, but they may work for you:

objectlistview, 2 forced conversion functions

0
source

I think you are looking for:

 objectListView.RefreshItem(item); 
0
source

Source: https://habr.com/ru/post/1337328/


All Articles