C# ListView的虚拟模式下,拖动滚动条,有时候发生如下错误? RRS feed

  • 问题

  • 处于 VirtualMode 中时,ListView RetrieveVirtualListItem 事件需要每个 ListView 列的列表视图子项?这是为何?
    2011年8月22日 2:57


  • 请看MSDN library里面说的:

    limits of virtual mode
    A few things to note when using Virtual ListView controls. It does not support all ListView features. Examples are:

    1. Tile View – if you are in Tile view in the ListView, it will change to LargeIcons instead.

    2. SelectedItems/CheckedItems – these properties are not supported. Instead, use the SelectedIndices/ChecjedIndices properties to figure out which items exist in those collections.

    3. Changing amount of sub items in a ListViewItem instance – when creating ListViewItem instances, you need to make sure that it has the appropriate amount of ListViewSubItem instances in it. With regular list view, you can omit some of them and they will appear empty in the ListView.

    4. ArrangeIcons() – this method is not supported.

    5. Groups – you cannot use groups in a virtual ListView.

    6. Positioning of items – you cannot position ListViewItems in any of the icon modes.

    7. Automatic sorting – you cannot use the Sort() method on the ListView or any associated operations.

    This is a partial list, but should cover most of the important things.

    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    2011年8月24日 6:53