System.Windows.Forms.ListView.TopItem Property

Gets or sets the first visible item in the control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public ListViewItem TopItem { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Initially, the item with the index position of zero (0) is at the top of the System.Windows.Forms.ListView control. If the System.Windows.Forms.ListView control contents are scrolled, a different item can be at the top of the control. You can use this property to indicate or determine which item is visible at the top of the System.Windows.Forms.ListView control. The value of the ListView.TopItem property will not always persist, depending on where the desired top item is in the list view.

The number of items visible in a System.Windows.Forms.ListView control at any time depends on the height of the list view and the size of the items it contains. If the items exceed the height of the list view, the items will continue onto multiple pages, which the user can scroll through. If you set the ListView.TopItem property to an item in the last page of the System.Windows.Forms.ListView, the item will automatically be scrolled into view; however, ListView.TopItem will be set to the actual top item of the last page.

To ensure that a specific item is in the visible region of the control (but not necessarily in the top position), use the ListView.EnsureVisible(int) method.

Note:

Setting this property has no effect when the ListView.Scrollable property value is false.

Setting this property is not supported in versions of the dnprdnshort prior to version 2.0.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0