2011-01-27 3 views
4

나는 ObjectListView을 사용합니다. RefreshObject() 메서드를 사용하여 수정 된 객체 만 업데이트합니다.ObjectListView에서 유일한 개체 새로 고침

// 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; 

하지만 아무 일도 발생하지 않습니다. 누가 그 문제인지 알아?

답변

0

olv 내게도 적합합니다. 모델 목록을 임시로 편집하여 objectlistview 외부로 업데이트한다는 사실을 알고 있습니까? 새로 고침 한 함수는 objectlistview 자체에서 수행 한 편집을 통해 모델을 강제 업데이트하기위한 것입니다.

뷰 외부에서 모델을 업데이트하는 경우 objectlistview는 디스플레이를 자동으로 업데이트한다고 말합니다. 그 진술은 나에게 상대적이 아닌 진리이지만 나는 여전히 연구 중이다. 좋은 해상도를 찾으면 여기에서 업데이트하겠습니다.

objectlistview, interesting feature - search for "After the update"

편집 : 나는 아직 나를 위해 작동 답을 발견하지 못했지만,이 당신을 위해 작동 할 수

:

objectlistview, 2 force-redraw functions

관련 문제