刷新ObjectListView中唯一的对象
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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
我想您正在寻找:
I think you are looking for: