刷新ObjectListView中唯一的对象

发布于 2024-10-14 17:39:43 字数 712 浏览 0 评论 0原文

我使用 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;

但什么也没发生。有谁知道是这么回事吗?

I use ObjectListView. And use method RefreshObject() to update the only modified 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 anybody know that's the matter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

在梵高的星空下 2024-10-21 17:39:43

olv 也让我不舒服。我是否理解您在 objectlistview 临时编辑之外更新了模型?您刷新的函数意味着通过在 objectlistview 本身中进行的编辑强制更新模型。

如果您要在视图之外更新模型,objectlistview 会自动更新显示。这个说法是事实,与我无关,但我仍在研究。如果我找到一个好的解决方案,我会在这里更新。

objectlistview,有趣的功能 - 搜索“更新后”

编辑:

我没有找到一个对我有用的答案,但这些可能对你有用:

objectlistview,2个强制重绘函数

olv gives me fits, too. do i understand that you update your model outside the objectlistview edit provisional? the function you refresh meant to force updates to the model from edits made in the objectlistview itself.

if you are updating the model outside the view, objectlistview says it updates the display automatically. that statement is a truth not relative to me, but i am still researching. i'll update here if i find a nice resolution.

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

edit:

i didn't find an answer that works for me yet, but these may work for you:

objectlistview, 2 force-redraw functions

吲‖鸣 2024-10-21 17:39:43

我想您正在寻找:

objectListView.RefreshItem(item);

I think you are looking for:

objectListView.RefreshItem(item);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文