加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 刷新ObjectListView中唯一的对象

发布时间:2020-12-15 21:14:42 所属栏目:百科 来源:网络整理
导读:我使用 ObjectListView.并使用方法RefreshObject()来更新唯一的修改对象. // 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 associati
我使用 ObjectListView.并使用方法RefreshObject()来更新唯一的修改对象.

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

但没有任何反应.有谁知道这件事吗?

解决方法

我想你正在寻找:

objectListView.RefreshItem(item);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读