ListViewUtil

From auWiki
Jump to: navigation, search

C# class that provides extension functions for working with ListView controls.

Namespace

au.util.comctl

Hierarchy
  • System.Object
    • au.util.comctl.ListViewUtil

Usage

With a reference to au.util.comctl and using au.util.comctl; a Form or UserControl hosting a ListView can use additional extension methods on the ListView object. Currently this includes complex sorting for ListView controls in detail view and obtaining the list of columns in their displayed order.

Public Methods

DetailSort

static void DetailSort(this ListView list, int sortColumnIndex, SortType sort, bool reverse, int indicatorColumnIndex)

static void DetailSort(this ListView list, int sortColumnIndex, SortType sort, int indicatorColumnIndex)

static void DetailSort(this ListView list, ColumnHeader sortColumn, SortType sort, bool reverse, ColumnHeader indicatorColumn)

static void DetailSort(this ListView list, ColumnHeader sortColumn, SortType sort, bool reverse)

static void DetailSort(this ListView list, int sortColumnIndex, SortType sort, bool reverse)

static void DetailSort(this ListView list, ColumnHeader sortColumn, bool reverse, ColumnHeader indicatorColumn)

static void DetailSort(this ListView list, int sortColumnIndex, bool reverse, int indicatorColumnIndex)

static void DetailSort(this ListView list, ColumnHeader sortColumn, bool reverse)

static void DetailSort(this ListView list, int sortColumnIndex, bool reverse)

static void DetailSort(this ListView list, ColumnHeader sortColumn, SortType sort, ColumnHeader indicatorColumn)

static void DetailSort(this ListView list, ColumnHeader sortColumn, SortType sort)

static void DetailSort(this ListView list, int sortColumnIndex, SortType sort)

static void DetailSort(this ListView list, ColumnHeader sortColumn, ColumnHeader indicatorColumn)

static void DetailSort(this ListView list, int sortColumnIndex, int indicatorColumnIndex)

static void DetailSort(this ListView list, ColumnHeader sortColumn)

static void DetailSort(this ListView list, int sortColumnIndex)

Sorts the items in a ListView in detail view by one of the columns, remembering previous sorting. Methods taking ColumnHeader instead of int are a convenience to save typing .Index when references to ColumnHeader objects are available.

  • list = ListView being sorted. This parameter is implicit if called as an extension method.
  • sortColumnIndex = Column to sort by.
  • sort = How to sort the data in the column. See SortType for options. If not specified, SortType.String is used.
  • reverse = True if list should be sorted in reverse order. If not specified and current sort column matches sortColumnIndex that column’s sorting is reversed. Otherwise, false is used.
  • indicatorColumnIndex = Column to show sort indicator on. If not specified, sortColumnIndex is used.

GetOrderedColumns

static ColumnHeader[] GetOrderedColumns(this ListView list)

Gets an array of ColumnHeaders from a ListView in the order in which they are actually displayed.

  • list = The ListView to get the ordered columns from. This parameter is implicit if called as an extension method.
  • @return = ColumnHeaders in the ListView, in display order.