Listview清除选择需要两个调用 [英] Listview clear selection needs two calls

查看:51
本文介绍了Listview清除选择需要两个调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试重置列表视图中的选择.列表视图处于虚拟模式.
我的代码如下:

Hello all,

I am trying to reset the selection in a listview. The listview is in virtual mode.
My code is as follows:

listView.SelectedIndices.Clear();
listView.Refresh();



如果运行代码,则什么也不会发生.如果它运行两次,或者当我在Refresh()上方添加对... Indices.Clear()的额外调用时,选择内容将清除.

我很困惑.

André



If the code is run, nothing happens. If it is run twice or when I add an extra call to ...Indices.Clear() above the Refresh(), the selection clears.

I''m puzzled.

André

推荐答案

listView.SelectedItems.Clear();效果如何更好?

祝你好运!
How about listView.SelectedItems.Clear(); does that work aqny better?

Good luck!


列表视图处于VirtualMode,因此不起作用

菲涅·费斯特达根(Fijne Feetdagen),
安德烈
(尝试添加评论,在这里不起作用)
The listview is in VirtualMode, so that doesn''t work

Fijne feestdagen,
André
(tried adding a comment, doesn''t work here)


这篇关于Listview清除选择需要两个调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆