working on – Owl's Blog on .NET development http://www.componentowl.com/blog Component Owl codes Better ListView control all night so you don't have to. Tue, 04 Sep 2018 13:10:05 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 Coming soon: Better ListView 2.1 Optimized for Performance http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond Mon, 05 Sep 2011 16:33:45 +0000 http://www.componentowl.com/blog/?p=348 Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

  • Faster collection operations (adding, removing, sorting) of large number of items
  • Faster expand/collapse of groups and items
  • Faster column resizing with multi-line items

We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

photo by Michael Roper

photo by Michael Roper

]]>
http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ 0
Work in Progress: “Groups” / “Item Hierarchy” Features http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond Fri, 25 Mar 2011 23:11:00 +0000 http://www.componentowl.com/blog/?p=204 We’re currently developing complex, but very useful features for the new major version of Better ListView:

  • Groups – to enable grouping items into collapsible areas with “group headers”
  • Item Hierarchy – to allow for visually organizing items like in the tree

We are facing some non-trivial obstacles on the journey You might be interested in:

Tree Structure vs List Structure

In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

Keeping Native Look

.NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

Visual Style Elements for Groups

Visual Style Elements for Groups

The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

]]>
http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ 0