JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the ListView Class

As discussed in the In Depth section of this chapter, list views display lists of items, much like the right pane in the Windows Explorer. List views are supported by the ListView class, which has this class hierarchy:

Object
   MarshalByRefObject
      Component
         Control
            ListView

You can find the notable public properties of ListView objects in Table 10.8, the notable public methods in Table 10.9, and the notable public events in Table 10.10. Note that I'm omitting those properties, methods, and events ListView objects inherit from the Control class—you'll find all that in Tables 5.1, 5.2, and 5.3, Chapter 5.

Table 10.8: Noteworthy public properties of ListView objects.

Property

Means

Activation

Gets/sets the user action to activate this item.

Alignment

Gets/sets the side of a window that items should be aligned to.

AllowColumnReorder

Gets/sets whether the user may drag column headers.

AutoArrange

Gets/sets if items are automatically arranged (using the Alignment property).

CheckBoxes

Gets/sets if every item should show a checkbox.

CheckedIndices

Gets the indices of currently checked items.

CheckedItems

Gets the currently checked items.

Columns

Gets a collection of columns.

FocusedItem

Gets the item that has the focus.

FullRowSelect

Gets/sets whether selecting an item will select the entire row.

GridLines

Gets/sets whether grid lines are drawn between items and their subitems.

HeaderStyle

Gets/sets the column header style.

HideSelection

Gets/sets whether selected items should be hidden when the list view loses the focus.

HoverSelection

Gets/sets if items can be selected by mouse hovering.

Items

Gets the list items.

LabelEdit

Gets/sets if the user can edit the item labels.

LabelWrap

Gets/sets whether item labels wrap for icon view.

LargeImageList

Gets/sets the ImageList for large icon view.

MultiSelect

Gets/sets whether multiple items can be selected.

Scrollable

Gets/sets if scroll bars should be visible.

SelectedIndices

Gets the indices of the selected items.

SelectedItems

Gets the selected items.

SmallImageList

Gets/sets the small icon image list.

Sorting

Gets/sets the sort order for the items.

TopItem

Gets the item at the top of the list.

View

Gets/sets the current view mode.

Table 10.9: Noteworthy public methods of ListView objects.

Method

Means

ArrangeIcons

Arranges the displayed items in Large Icon or Small Icon view.

BeginUpdate

Stops the list view from redrawing.

Clear

Removes all items from the list view.

EndUpdate

Allows redrawing of the list view.

EnsureVisible

Makes sure that an item is visible.

GetItemAt

Gets the item corresponding to the given X,Y coordinate.

Table 10.10: Noteworthy public methods of ListView objects.

Event

Means

AfterLabelEdit

Occurs when a label has been edited.

BeforeLabelEdit

Occurs before a label is changed.

ColumnClick

Occurs when a column is clicked.

ItemActivate

Occurs when an item is activated.

ItemCheck

Occurs when an item is checked.

SelectedIndexChanged

Occurs when the selected index changes.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor