Skip to main content
Version: 4.1

ListView

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a list view control, which displays a collection of items that can be displayed using one of four different views.

public class ListView : Control, IWisejDataStore

Constructors​

Instance member ListView()​

Initializes a new instance of the ListView class.

Properties​

Instance member AllowColumnReorder​

Boolean: Returns or sets whether the user can drag column headers to reorder columns in the control. (Default: False)

Instance member AllowColumnSorting​

Boolean: Returns or sets whether the user can sort columns by clicking on the header. (Default: False)

Instance member BorderStyle​

BorderStyle: Returns or sets the border style of the control. (Default: Solid)

Instance member CheckBoxes​

Boolean: Returns or sets whether a check box appears next to each item. (Default: False)

Instance member CheckedIndices​

CheckedIndexCollection: Returns the indexes of the currently checked items in the control.

Instance member CheckedItems​

CheckedListViewItemCollection: Returns the currently checked items in the control.

Instance member ColumnCount​

Int32: Returns the number of columns without creating the columns collection.

Instance member Columns​

ColumnHeaderCollection: Returns the collection of all column headers that appear in the control.

Instance member DataMember​

String: Returns or sets the name of the list or table in the data source for which the ListView is displaying data. (Default: "")

Instance member DataSource​

Object: Returns or sets the data source for this ListView. (Default: null)

Throws:

Protected member DefaultItemPadding​

Padding: Returns the default value for the ItemPadding property.

Instance member DisplayPropertyName​

String: Returns or sets the property to display in the Items. (Default: "")

Instance member FocusedItem​

ListViewItem: Returns or sets the item that currently has the focus.

Instance member GridLines​

Boolean: Returns or sets whether grid lines appear between the rows and columns containing the items and subitems in the control. (Default: True)

Instance member GridLineStyle​

GridLineStyle: Returns or sets the cell border style for the ListView control when its View property is set to Details and the GridLines property is set to true. (Default: Vertical)

Instance member HeaderStyle​

ColumnHeaderStyle: Returns or sets the column header style. (Default: Clickable)

Instance member HScroll​

Boolean: Returns whether the horizontal scroll bar is visible.

Instance member IconPropertyName​

String: Returns or sets the property to use as the icon for the Items. (Default: "")

Instance member ItemPadding​

Padding: Returns or sets the padding inside ListViewItem objects in any View mode.

Instance member Items​

ListViewItemCollection: Returns a collection containing all items in the control.

Instance member ItemSize​

Size: Returns or sets the size of the items in the list view. If left empty (0, 0), the control uses the item size set in the current theme.

Instance member ItemSorter​

IComparer<ListViewItem>: Returns or sets the sorting comparer for the control.

Instance member LabelEdit​

Boolean: Returns or sets whether the user can edit the labels of items in the control. (Default: False)

Instance member LabelWrap​

Boolean: Returns or sets whether the text in the ListViewItem item can wrap. (Default: False)

Instance member LargeImageList​

ImageList: Returns or sets the ImageList to use to display the icon in the ListViewItem elements when the View is set to LargeIcon or Tile. (Default: null)

If LargeImageList is not set, Wisej will use SmallImageList and scale the icons.

Instance member LiveResize​

Boolean: Returns or sets whether the column and row resizing should be updated as the user resizes the row or the column. (Default: False)

Instance member MultiSelect​

Boolean: Returns or sets whether multiple items can be selected. (Default: False)

Instance member PrefetchItems​

Int32: Returns or sets the number of items to prefetch outside of the visible area. The default is 0 (disabled). (Default: 0)

Setting the property PrefetchItems to a value greater than 0 allows the virtual view to prefetch the specified number of items outside of the visible area to enable smoother scrolling.

Instance member Scrollable​

Boolean: Returns or sets whether a scroll bar is added to the control when there is not enough room to display all items. (Default: True)

Instance member SelectedIndex​

Int32: Returns or sets the index of the focused ListViewItem.

Instance member SelectedIndices​

SelectedIndexCollection: Returns the indexes of the selected items in the control.

Instance member SelectedItems​

SelectedListViewItemCollection: Returns the items that are selected in the control.

Instance member SelectionMode​

SelectionMode: Returns or sets the current selection mode determining how items are selected in the ListView. (Default: One)

When in Details view, the MultiSimple behaves as the MultiExtended. The DataGridView that renders the details view supports only the MultiSelect property true or false and uses the SelectionMode property to determine how elements of the grid are selected, which is always set to FullRowSelect when use inside the ListView.

Instance member ShowItemToolTips​

Boolean: Returns or sets whether ToolTips are shown for the ListViewItem objects contained in the ListView. (Default: False)

Instance member SmallImageList​

ImageList: Returns or sets the ImageList to use to display the icon in the ListViewItem elements when the View is set to SmallIcon or Details. (Default: null)

If SmallImageList is not set, Wisej will use LargeImageList and scale the icons.

Instance member SortedColumn​

ColumnHeader: Returns the column by which the ListView contents are currently sorted.

Instance member Sorting​

SortOrder: Returns or sets the sort order for items in the control. (Default: None)

Instance member SortOrder​

SortOrder: Returns a value indicating whether the items in the ListView control are sorted in ascending or descending order, or are not sorted.

Instance member StateImageList​

ImageList: Returns or sets the ImageList associated with states set for each ListViewItem. (Default: null)

Instance member Tools​

ComponentToolCollection: Returns the collection of the ComponentTool items associated with this control.

Instance member ToolsPosition​

Position: Returns or sets the position of the ComponentTool items associated with this control. (Default: Top)

Instance member View​

View: Returns or sets how items are displayed in the control. (Default: LargeIcon)

Instance member VirtualListSize​

Int32: Returns or sets the number of ListViewItem objects contained in the list when in virtual mode. (Default: 0)

Throws:

Instance member VirtualMode​

Boolean: Returns or sets whether you have provided your own data-management operations for the ListView control. (Default: False)

Instance member VScroll​

Boolean: Returns whether the vertical scroll bar is visible.

Methods​

Instance member Append(data, dataMember)​

Populates the DataGridView from the data appending the rows to the existing rows.

ParameterTypeDescription
dataObjectThe object that contains data for the ListView to display.
dataMember optionalStringThe name of the table or list in the data object for which the DataGridView should load the items.

Returns: Int32. Numbers of items appended.

Use this method to fill a ListView without binding it to the data source.

Instance member AutoResizeColumn(columnIndex, headerAutoResize)​

Resizes the width of the given column as indicated by the resize style.

ParameterTypeDescription
columnIndexInt32The zero-based index of the column to resize.
headerAutoResizeColumnHeaderAutoResizeStyleOne of the ColumnHeaderAutoResizeStyle values.

Throws:

Instance member AutoResizeColumns(headerAutoResize)​

Resizes the width of the columns as indicated by the resize style.

ParameterTypeDescription
headerAutoResizeColumnHeaderAutoResizeStyleOne of the ColumnHeaderAutoResizeStyle values.

Throws:

Instance member BeginUpdate()​

Prevents the control from updating until the EndUpdate method is called.

Instance member Clear()​

Removes all items and columns from the control.

Instance member ClearSelection()​

Clears the current selection.

Protected member CreateCellEditor()​

Creates and returns a new control to be used as the cell editor.

Returns: Control. A Control instance that serves as the cell editor.

This method is intended to be overridden in a derived class to provide a custom cell editor. The returned control will be used to edit the value of a cell.

Protected member Dispose(disposing)​

Disposes the control and all the owned columns.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member EndUpdate()​

Resumes updating of the list view control after suspending it by the BeginUpdate method.

Instance member EnsureVisible(index)​

Ensures that the specified item is visible within the control, scrolling the contents of the control if necessary.

ParameterTypeDescription
indexInt32The zero-based index of the item to scroll into view.

Throws:

Instance member Fill(data, dataMember)​

Populates the ListView from the data .

ParameterTypeDescription
dataObjectThe object that contains data for the ListView to display.
dataMember optionalStringThe name of the table or list in the data object for which the ListView should load the items.

Returns: Int32. Numbers of items added.

Use this method to fill a ListView without binding it to the data source.

Instance member FindItemWithText(text)​

Finds the first ListViewItem that begins with the specified text value.

ParameterTypeDescription
textStringThe text to search for.

Returns: ListViewItem. The first ListViewItem that begins with the specified text value.

Instance member FindItemWithText(text, includeSubItemsInSearch, startIndex)​

Finds the first ListViewItem or ListViewSubItem, if indicated, that begins with the specified text value. The search starts at the specified index.

ParameterTypeDescription
textStringThe text to search for.
includeSubItemsInSearchBooleantrue to include sub-items in the search; otherwise, false.
startIndexInt32The index of the item at which to start the search.

Returns: ListViewItem. The first ListViewItem that begins with the specified text value.

Throws:

Instance member FindItemWithText(text, includeSubItemsInSearch, startIndex, isPrefixSearch)​

Finds the first ListViewItem or ListViewSubItem, if indicated, that begins with the specified text value. The search starts at the specified index.

ParameterTypeDescription
textStringThe text to search for.
includeSubItemsInSearchBooleantrue to include sub-items in the search; otherwise, false.
startIndexInt32The index of the item at which to start the search.
isPrefixSearchBooleantrue to allow partial matches; otherwise, false.

Returns: ListViewItem. The first ListViewItem that begins with the specified text value.

Throws:

Instance member IsValidColumn(colIndex)​

Verifies that the column index refer to a valid column.

ParameterTypeDescription
colIndexInt32The index of the column to verify.

Returns: Boolean. true if the column index corresponds to a valid column.

Protected member OnAddReferences(list)​

Returns a collection of referenced components or collection of components.

ParameterTypeDescription
listIList

Protected member OnAfterLabelEdit(e)​

Fires the AfterLabelEdit event.

ParameterTypeDescription
eLabelEditEventArgsA LabelEditEventArgs that contains the event data.

Protected member OnBeforeLabelEdit(e)​

Fires the BeforeLabelEdit event.

ParameterTypeDescription
eLabelEditEventArgsA LabelEditEventArgs that contains the event data.

Protected member OnBindingContextChanged(e)​

Fires the BindingContextChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnCacheVirtualItems(e)​

Fires the CacheVirtualItems event.

ParameterTypeDescription
eCacheVirtualItemsEventArgsA CacheVirtualItemsEventArgs that contains the event data.

Protected member OnColumnClick(e)​

Fires the ColumnClick event.

ParameterTypeDescription
eColumnClickEventArgsA ColumnClickEventArgs that contains the event data.

Protected member OnColumnDoubleClick(e)​

Fires the ColumnDoubleClick event.

ParameterTypeDescription
eColumnClickEventArgsA ColumnClickEventArgs that contains the event data.

Protected member OnColumnReordered(e)​

Fires the ColumnReordered event.

ParameterTypeDescription
eColumnReorderedEventArgsThe ColumnReorderedEventArgs that contains the event data.

Protected member OnColumnWidthChanged(e)​

Fires the ColumnWidthChanged event.

ParameterTypeDescription
eColumnWidthChangedEventArgsA ColumnWidthChangedEventArgs that contains the event data.

Protected member OnDataBindingComplete(e)​

Fires the DataBindingComplete event.

ParameterTypeDescription
eListViewBindingCompleteEventArgsA ListViewBindingCompleteEventArgs that contains the event data.

Protected member OnDataMemberChanged(e)​

Fires the DataMemberChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnDataSourceChanged(e)​

Fires the DataSourceChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDataUpdated(e)​

Fires the DataUpdated event.

ParameterTypeDescription
eListViewDataUpdatedEventArgsA ListViewDataUpdatedEventArgs that contains the event data.

Protected member OnItemCheck(e)​

Fires the ItemCheck event.

ParameterTypeDescription
eItemCheckEventArgsAn ItemCheckEventArgs that contains the event data.

Protected member OnItemChecked(e)​

Fires the ItemChecked event.

ParameterTypeDescription
eItemCheckedEventArgsAn ItemCheckedEventArgs that contains the event data.

Protected member OnItemClick(e)​

Fires the ItemClick event.

ParameterTypeDescription
eItemClickEventArgsA ItemClickEventArgs that contains the event data.

Protected member OnItemDoubleClick(e)​

Fires the ItemDoubleClick event.

ParameterTypeDescription
eItemClickEventArgsA ItemClickEventArgs that contains the event data.

Protected member OnItemDrag(e)​

Fires the ItemDrag event.

ParameterTypeDescription
eListViewItemDragEventArgsAn ItemDragEventArgs that contains the event data.

Protected member OnItemMouseHover(e)​

Fires the ItemMouseHover event.

ParameterTypeDescription
eItemMouseHoverEventArgsA ItemMouseHoverEventArgs that contains the event data.

Protected member OnItemMouseLeave(e)​

Fires the ItemMouseLeave event.

ParameterTypeDescription
eItemMouseHoverEventArgsA ItemMouseHoverEventArgs that contains the event data.

Protected member OnItemSelectionChanged(e)​

Fires the ItemSelectionChanged event.

ParameterTypeDescription
eItemSelectionChangedEventArgsA ItemSelectionChangedEventArgs that contains the event data.

Protected member OnKeyDown(e)​

Fires the KeyDown event.

ParameterTypeDescription
eKeyEventArgsA KeyEventArgs that contains the event data.

Protected member OnMouseUp(e)​

Fires the MouseUp event.

ParameterTypeDescription
eMouseEventArgsA MouseEventArgs that contains the event data.

Protected member OnRetrieveVirtualItem(e)​

Fires the RetrieveVirtualItem event.

ParameterTypeDescription
eRetrieveVirtualItemEventArgsA RetrieveVirtualItemEventArgs that contains the event data.

Protected member OnScroll(e)​

Fires the Scroll event.

ParameterTypeDescription
eScrollEventArgsA ScrollEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Protected member OnSearchForVirtualItem(e)​

Fires the SearchForVirtualItem event.

ParameterTypeDescription
eSearchForVirtualItemEventArgsA SearchForVirtualItemEventArgs that contains the event data.

Protected member OnSelectedIndexChanged(e)​

Fires the SelectedIndexChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnToolClick(e)​

Fires the ToolClick event.

ParameterTypeDescription
eToolClickEventArgsA ToolClickEventArgs that contains the event data.

Protected member OnVirtualItemsSelectionRangeChanged(e)​

Fires the VirtualItemsSelectionRangeChanged event.

Protected member OnWebDataCount()​

Returns the number of available data rows.

Returns: Int32.

Protected member OnWebDataRead(firstIndex, lastIndex, sortDirection, sortIndex)​

Returns the data requested by the client.

ParameterTypeDescription
firstIndexInt32The index of the first requested row.
lastIndexInt32The index of the last requested row.
sortDirectionListSortDirectionThe sort direction.
sortIndexInt32The index of the sorted column. Can be -1 if there is no sorted column.

Returns: Object.

Protected member OnWebEvent(e)​

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member OnWebUpdate(state)​

Updates the client component using the state information.

ParameterTypeDescription
stateObjectDynamic state object.

Instance member Refresh()​

Forces a full reload of the data displayed by this ListView.

Instance member Refresh(refreshChildren)​

Forces a full reload of the data displayed by this ListView.

ParameterTypeDescription
refreshChildrenBooleanTrue to also refresh all the children of this control.

Protected member RefreshItem(index)​

Resynchronizes the item data with the contents of the data source.

ParameterTypeDescription
indexInt32

Protected member RefreshItems()​

Resynchronizes the item data with the contents of the data source.

Instance member ScrollColumnIntoView(column)​

Scrolls the specified column into view.

ParameterTypeDescription
columnColumnHeaderThe ColumnHeaderto scroll into view.

Throws:

Instance member ScrollItemIntoView(item)​

Scrolls the specified item into view.

ParameterTypeDescription
itemListViewItemThe item to scroll into view.

Throws:

Instance member SelectAll()​

Selects all items in the ListView.

Instance member Sort(comparison)​

Sorts the items of the list view.

ParameterTypeDescription
comparison optionalComparison<ListViewItem>The comparison expression to use when sorting the items. It's optional - if not specified or null, the ItemSorter instance or a default internal comparer is used to compare the items and sort the list.

Instance member Update()​

Causes the control to update the corresponding client side widget. When in design mode, causes the rendered control to update its entire surface in the designer.

Events​

Instance member AfterLabelEdit​

LabelEditEventHandler Fired when the label for an item is edited by the user.

Instance member BeforeLabelEdit​

LabelEditEventHandler Fired when the user starts editing the label of an item.

Instance member CacheVirtualItems​

CacheVirtualItemsEventHandler Fired when the contents of the display area for a ListView in virtual mode has changed, and the ListView determines that a new range of items is needed.

Instance member ColumnClick​

ColumnClickEventHandler Fired when the user clicks a column header within the list view control.

Instance member ColumnDoubleClick​

ColumnClickEventHandler Fired when the user double clicks a column header within the list view control.

Instance member ColumnReordered​

ColumnReorderedEventHandler Fired when the column header order is changed.

Instance member ColumnWidthChanged​

ColumnWidthChangedEventHandler Fired after the width of a column is successfully changed .

Instance member DataBindingComplete​

ListViewBindingCompleteEventEventHandler Occurs after a data-binding operation has finished.

Instance member DataMemberChanged​

EventHandler Fired when value of the DataMember property changes.

Instance member DataSourceChanged​

EventHandler Fired when the DataSource property changes.

Instance member DataUpdated​

ListViewDataUpdatedEventHandler Fired when the client has updated one or more items in the view.

This event is fired only if the application has attached at least one handler to the event. Otherwise, simply overriding OnDataUpdated won't work.

Instance member ItemCheck​

ItemCheckEventHandler Fired when the check state of an item changes.

Instance member ItemChecked​

ItemCheckedEventHandler Fired when the checked state of an item changes.

Instance member ItemClick​

ItemClickEventHandler Fired when the item is clicked or tapped.

Instance member ItemDoubleClick​

ItemClickEventHandler Fired when the item is double clicked or tapped.

Instance member ItemDrag​

ListViewItemDragEventHandler Fired when the user begins dragging a ListViewItem.

Instance member ItemMouseHover​

ItemMouseHoverEventHandler Fired when the pointer hovers over an item.

Instance member ItemMouseLeave​

ItemMouseHoverEventHandler Fired when the pointer leaves an item.

Instance member ItemSelectionChanged​

ItemSelectionChangedEventHandler Fired when the selection state of an item changes.

Instance member RetrieveVirtualItem​

RetrieveVirtualItemEventHandler Fired when the ListView is in virtual mode and requires a ListViewItem.

Throws:

Instance member Scroll​

ScrollEventHandler Fired when the user or code scrolls the ListView.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member SearchForVirtualItem​

SearchForVirtualItemEventHandler Fired when the ListView is in virtual mode and a search is requested.

Instance member SelectedIndexChanged​

EventHandler Fired when the SelectedIndices collection changes.

Instance member ToolClick​

ToolClickEventHandler Fired when a ComponentTool is clicked.

Instance member VirtualItemsSelectionRangeChanged​

ListViewVirtualItemsSelectionRangeChangedEventHandler Fired when a ListView is in virtual mode and the selection state of a range of items has changed.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejDataStoreAll wisej data stores implement this interface.
IWisejSerializableAllows an object to serialize itself.