columns – 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 Centering Images in Better ListView Sub-items http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond Wed, 06 Aug 2014 21:14:10 +0000 http://www.componentowl.com/blog/?p=906 Centered images in Better ListView

Centered images in Better ListView

Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

The image will be centered inside available space regardless of text.

This is useful for sub-items and column headers consisting of image only.

]]>
http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ 0
How to Hide a Column in Better ListView http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond Fri, 05 Aug 2011 11:56:31 +0000 http://www.componentowl.com/blog/?p=330 The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

So how we neatly hide a column?

We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

 

Hiding column via context menu

Hiding column via context menu...

 

The sixth column is hidden...

...and the sixth column gets hidden.

 

Download Better ListView

]]>
http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ 0