Codelog

foreach(Snippet aSnippet in CodeLog){ aSnippet.GetSolution(); }

ListView control in C#

without comments

ListView control is like a ListBox control but with more functionalities. With such a control one can get a pane that looks excatly like the right pane in windows explorer. Certain stuffs that stand out in this control when you compare it with the ListBox control are,

Views
ListView control has many views like,

  • LargeIcon - The list items are listed as tiles (the usual windows tile view style). There will not be any horizontal scrollbar by default in this view
  • Details - The list items will have more columns that tells about addition information of any item
  • SmallIcon - Similar to LargeIcon, but will have small images to the left of eash item
  • List - The usual ListBox style
  • Tile - Combination of ListStyle and LargeIcon style views

ImageList
Using ListView control one can assiciate images with list items

Checkboxes
We can even add checkboxes to each and every items. This is not supported in Tile view though

HotTracking

Having items that behaves like hyperlinks

Columns
In the Details view one can have many columns and items can be added under each column (like the windows explorer Details view style). On can even sort things under the ListView control just by clicking the headers of the ListView control.

Grids

Under the Details view, we can display items in grids, giving it the classic datagrid view style

Tooltip text
Show tooltips for the list items just by making this property to true

This post is intended to be an introduction to the functionalities of a ListView control. My next post will be about the ways of using these funtionalities.

Written by sudarsanyes

July 16th, 2008 at 6:20 pm

Posted in C#, Controls, UI

Tagged with , ,

Leave a Reply