ListView
Wisej.Web.ListView
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.0.0.0)
Represents a list view control, which displays a collection of items that can be displayed using one of four different views.
Constructors
ListView()
Initializes a new instance of the ListView class.
Properties
AllowColumnReorder
Boolean: Returns or sets whether the user can drag column headers to reorder columns in the control.
AllowColumnSorting
Boolean: Returns or sets whether the user can sort columns by clicking on the header.
BorderStyle
BorderStyle: Returns or sets the border style of the control.
CheckBoxes
Boolean: Returns or sets whether a check box appears next to each item.
CheckedIndices
CheckedIndexCollection: Returns the indexes of the currently checked items in the control.
CheckedItems
CheckedListViewItemCollection: Returns the currently checked items in the control.
ColumnCount
Int32: Returns the number of columns without creating the columns collection.
Columns
ColumnHeaderCollection: Returns the collection of all column headers that appear in the control.
DataMember
String: Returns or sets the name of the list or table in the data source for which the ListView is displaying data.
DataSource
Object: Returns or sets the data source for this ListView.
Throws:
ArgumentException The assigned value does not implement the IList or IListSource interfaces.
DisplayPropertyName
String: Returns or sets the property to display in the Items.
FocusedItem
ListViewItem: Returns or sets the item that currently has the focus.
GridLines
Boolean: Returns or sets whether grid lines appear between the rows and columns containing the items and subitems in the control.
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.
HeaderStyle
ColumnHeaderStyle: Returns or sets the column header style.
IconPropertyName
String: Returns or sets the property to use as the icon for the Items.
ItemPadding
Padding: Returns or sets the padding inside ListViewItem objects in any View mode.
Items
ListViewItemCollection: Returns a collection containing all items in the control.
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.
ItemSorter
IComparer<ListViewItem>: Returns or sets the sorting comparer for the control.
LabelEdit
Boolean: Returns or sets whether the user can edit the labels of items in the control.
LabelWrap
Boolean: Returns or sets whether the text in the ListViewItem item can wrap.
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.
If LargeImageList is not set, Wisej will use SmallImageList and scale the icons.
LiveResize
Boolean: Returns or sets whether the column and row resizing should be updated as the user resizes the row or the column.
MultiSelect
Boolean: Returns or sets whether multiple items can be selected.
PrefetchItems
Int32: Returns or sets the number of items to prefetch outside of the visible area. The default is 0 (disabled).
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.
Scrollable
Boolean: Returns or sets whether a scroll bar is added to the control when there is not enough room to display all items.
SelectedIndex
Int32: Returns or sets the index of the focused ListViewItem.
SelectedIndices
SelectedIndexCollection: Returns the indexes of the selected items in the control.
SelectedItems
SelectedListViewItemCollection: Returns the items that are selected in the control.
SelectionMode
SelectionMode: Returns or sets the current selection mode determining how items are selected in the ListView.
ShowItemToolTips
Boolean: Returns or sets whether ToolTips are shown for the ListViewItem objects contained in the ListView.
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.
If SmallImageList is not set, Wisej will use LargeImageList and scale the icons.
SortedColumn
ColumnHeader: Returns the column by which the ListView contents are currently sorted.
Sorting
SortOrder: Returns or sets the sort order for items in the control.
SortOrder
SortOrder: Returns a value indicating whether the items in the ListView control are sorted in ascending or descending order, or are not sorted.
StateImageList
ImageList: Returns or sets the ImageList associated with states set for each ListViewItem.
Tools
ComponentToolCollection: Returns the collection of the ComponentTool items associated with this control.
ToolsPosition
Position: Returns or sets the position of the ComponentTool items associated with this control.
View
View: Returns or sets how items are displayed in the control.
VirtualListSize
Int32: Returns or sets the number of ListViewItem objects contained in the list when in virtual mode.
Throws:
ArgumentException VirtualListSize is set to a value less than 0.
VirtualMode
Boolean: Returns or sets whether you have provided your own data-management operations for the ListView control.
Methods
Append(data, dataMember)
Populates the DataGridView from the data appending the rows to the existing rows.
Parameter | Type | Description |
---|---|---|
data | The object that contains data for the ListView to display. | |
dataMember | The 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.
AutoResizeColumn(columnIndex, headerAutoResize)
Resizes the width of the given column as indicated by the resize style.
Parameter | Type | Description |
---|---|---|
columnIndex | The zero-based index of the column to resize. | |
headerAutoResize | One of the ColumnHeaderAutoResizeStyle values. |
Throws:
ArgumentOutOfRangeException columnIndex is greater than 0 when Columns is null-or- columnIndex is less than 0 or greater than the number of columns set.
AutoResizeColumns(headerAutoResize)
Resizes the width of the columns as indicated by the resize style.
Parameter | Type | Description |
---|---|---|
headerAutoResize | One of the ColumnHeaderAutoResizeStyle values. |
Throws:
InvalidOperationException AutoResizeColumn is called with a value other than None when View is not set to Details.
BeginUpdate()
Prevents the control from updating until the EndUpdate method is called.
Clear()
Removes all items and columns from the control.
ClearSelection()
Clears the current selection.
EndUpdate()
Resumes updating of the list view control after suspending it by the BeginUpdate method.
EnsureVisible(index)
Ensures that the specified item is visible within the control, scrolling the contents of the control if necessary.
Parameter | Type | Description |
---|---|---|
index | The zero-based index of the item to scroll into view. |
Fill(data, dataMember)
Populates the ListView from the data .
Parameter | Type | Description |
---|---|---|
data | The object that contains data for the ListView to display. | |
dataMember | The 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.
FindItemWithText(text)
Finds the first ListViewItem that begins with the specified text value.
Parameter | Type | Description |
---|---|---|
text | The text to search for. |
Returns: ListViewItem. The first ListViewItem that begins with the specified text value.
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.
Parameter | Type | Description |
---|---|---|
text | The text to search for. | |
includeSubItemsInSearch | true to include sub-items in the search; otherwise, false. | |
startIndex | The index of the item at which to start the search. |
Returns: ListViewItem. The first ListViewItem that begins with the specified text value.
Throws:
ArgumentOutOfRangeException startIndex is less 0 or more than the number items in the ListView.
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.
Parameter | Type | Description |
---|---|---|
text | The text to search for. | |
includeSubItemsInSearch | true to include sub-items in the search; otherwise, false. | |
startIndex | The index of the item at which to start the search. | |
isPrefixSearch | true to allow partial matches; otherwise, false. |
Returns: ListViewItem. The first ListViewItem that begins with the specified text value.
Throws:
ArgumentOutOfRangeException startIndex is less than 0 or more than the number of items in the ListView.
Refresh()
Forces a full reload of the data displayed by this ListView.
Refresh(refreshChildren)
Forces a full reload of the data displayed by this ListView.
Parameter | Type | Description |
---|---|---|
refreshChildren | True to also refresh all the children of this control. |
ScrollColumnIntoView(column)
Scrolls the specified column into view.
Parameter | Type | Description |
---|---|---|
column | The ColumnHeaderto scroll into view. |
Sort(comparison)
Sorts the items of the list view.
Parameter | Type | Description |
---|---|---|
comparison | 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. |
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
AfterLabelEdit
LabelEditEventHandler Fired when the label for an item is edited by the user.
BeforeLabelEdit
LabelEditEventHandler Fired when the user starts editing the label of an item.
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.
ColumnClick
ColumnClickEventHandler Fired when the user clicks a column header within the list view control.
ColumnDoubleClick
ColumnClickEventHandler Fired when the user double clicks a column header within the list view control.
ColumnReordered
ColumnReorderedEventHandler Fired when the column header order is changed.
ColumnWidthChanged
ColumnWidthChangedEventHandler Fired after the width of a column is successfully changed .
DataBindingComplete
ListViewBindingCompleteEventEventHandler Occurs after a data-binding operation has finished.
DataMemberChanged
EventHandler Fired when value of the DataMember property changes.
DataSourceChanged
EventHandler Fired when the DataSource property changes.
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.
ItemCheck
ItemCheckEventHandler Fired when the check state of an item changes.
ItemChecked
ItemCheckedEventHandler Fired when the checked state of an item changes.
ItemClick
ItemClickEventHandler Fired when the item is clicked or tapped.
ItemDoubleClick
ItemClickEventHandler Fired when the item is double clicked or tapped.
ItemDrag
ListViewItemDragEventHandler Fired when the user begins dragging a ListViewItem.
ItemMouseHover
ItemMouseHoverEventHandler Fired when the pointer hovers over an item.
ItemMouseLeave
ItemMouseHoverEventHandler Fired when the pointer leaves an item.
ItemSelectionChanged
ItemSelectionChangedEventHandler Fired when the selection state of an item changes.
RetrieveVirtualItem
RetrieveVirtualItemEventHandler Fired when the ListView is in virtual mode and requires a ListViewItem.
Throws:
InvalidOperationException The Item property is not set to an item when the RetrieveVirtualItem event is handled.
SearchForVirtualItem
SearchForVirtualItemEventHandler Fired when the ListView is in virtual mode and a search is requested.
SelectedIndexChanged
EventHandler Fired when the SelectedIndices collection changes.
ToolClick
ToolClickEventHandler Fired when a ComponentTool is clicked.
VirtualItemsSelectionRangeChanged
ListViewVirtualItemsSelectionRangeChangedEventHandler Fired when a ListView is in virtual mode and the selection state of a range of items has changed.
Implements
Name | Description |
---|---|
Bindable components implement this interface. | |
All wisej components implement this interface. | |
All wisej controls derived from the Control class must implement this interface. | |
All wisej data stores implement this interface. | |
Allows an object to serialize itself. |
Last updated