Skip to main content
Version: 3.5

ColumnHeaderCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents the collection of column headers in a ListView control.

public class ColumnHeaderCollection : IList, ICollection, IEnumerable, IList<ColumnHeader>, ICollection<ColumnHeader>, IEnumerable<ColumnHeader>

Constructors

Instance memberColumnHeaderCollection(owner)

Initializes a new instance of the ColumnHeaderCollection class.

NameTypeDescription
ownerListViewThe ListView that owns this collection.

Properties

Instance memberCount

Int32: Returns the number of items in the collection.

Instance memberIsReadOnly

Boolean: Returns whether the collection is read-only.

Instance memberItem(index)

ColumnHeader: Returns the column header at the specified index within the collection.

Throws:

Instance memberItem(key)

ColumnHeader: Returns the column header with the specified key from the collection.

Methods

Instance memberAdd(text, width, textAlign)

Adds a column header to the collection with specified text, width, and alignment settings.

ParameterTypeDescription
textStringThe text to display in the column header.
widthInt32The initial width of the column header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.

Returns: ColumnHeader. The ColumnHeader that was created and added to the collection.

Instance memberAdd(header)

Adds an existing ColumnHeader to the collection.

ParameterTypeDescription
headerColumnHeaderThe ColumnHeader to add to the collection.

Returns: Int32. The zero-based index into the collection where the item was added.

Instance memberAdd(text)

Creates and adds a column with the specified text to the collection.

ParameterTypeDescription
textStringThe text to display in the column header.

Returns: ColumnHeader. The ColumnHeader with the specified text that was added to the ColumnHeaderCollection.

Instance memberAdd(text, width)

Creates and adds a column with the specified text and width to the collection.

ParameterTypeDescription
textStringThe text of the ColumnHeader to add to the collection.
widthInt32The width of the ColumnHeader to add to the collection.

Returns: ColumnHeader. The ColumnHeader with the specified text and width that was added to the ColumnHeaderCollection.

Instance memberAdd(key, text)

Creates and adds a column with the specified text and key to the collection.

ParameterTypeDescription
keyStringThe key of the ColumnHeader to add to the collection.
textStringThe text of the ColumnHeader to add to the collection.

Returns: ColumnHeader. The ColumnHeader with the specified key and text that was added to the ColumnHeaderCollection.

Instance memberAdd(key, text, width)

Creates and adds a column with the specified text, key, and width to the collection.

ParameterTypeDescription
keyStringThe key of the column header.
textStringThe text to display in the column header.
widthInt32The initial width of the ColumnHeader.

Returns: ColumnHeader. The ColumnHeader with the given text, key, and width that was added to the collection.

Instance memberAdd(key, text, width, textAlign, imageKey)

Creates and adds a column with the specified key, aligned text, width, and image key to the collection.

ParameterTypeDescription
keyStringThe key of the column header.
textStringThe text to display in the column header.
widthInt32The initial width of the column header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.
imageKeyStringThe key value of the image to display in the column header.

Returns: ColumnHeader. The ColumnHeader with the specified key, aligned text, width, and image key that has been added to the collection.

Instance memberAdd(key, text, width, textAlign, imageIndex)

Creates and adds a column with the specified key, aligned text, width, and image index to the collection.

ParameterTypeDescription
keyStringThe key of the column header.
textStringThe text to display in the column header.
widthInt32The initial width of the column header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.
imageIndexInt32The index value of the image to display in the column.

Returns: ColumnHeader. The ColumnHeader with the specified key, aligned text, width, and image index that has been added to the collection.

Instance memberAddRange(headers)

Adds an array of column headers to the collection.

ParameterTypeDescription
headersColumnHeader[]An array of ColumnHeader objects to add to the collection.

Instance memberClear()

Removes all column headers from the collection.

Instance memberClear(dispose)

Removes all column headers from the collection and optionally disposes them.

ParameterTypeDescription
disposeBooleanIndicates that the child columns should be disposed after being removed.

Instance memberContains(header)

Determines whether the specified header is located in the collection.

ParameterTypeDescription
headerColumnHeaderA ColumnHeader representing the header to locate in the collection.

Returns: Boolean. true if the header is contained in the collection; otherwise, false.

Instance memberContainsKey(key)

Determines if a header with the specified key is contained in the collection.

ParameterTypeDescription
keyStringThe name of the header to search for.

Returns: Boolean. true if a header with the specified name is contained in the collection; otherwise, false.

Instance memberCopyTo(array, arrayIndex)

ParameterTypeDescription
arrayColumnHeader[]
arrayIndexInt32

Instance memberGetEnumerator()

Returns an enumerator to use to iterate through the column header collection.

Returns: IEnumerator. An IEnumerator that represents the column header collection.

Instance memberIndexOf(value)

Returns the index, within the collection, of the specified header.

ParameterTypeDescription
valueColumnHeaderA ColumnHeader representing the header to locate in the collection.

Returns: Int32. The zero-based index of the header's location in the collection. If the header is not located in the collection, the return value is -1.

Instance memberIndexOfKey(key)

Determines the index for a header with the specified key.

ParameterTypeDescription
keyStringThe name of the header to retrieve the index for.

Returns: Int32. The zero-based index for the first occurrence of the column with the specified name, if found; otherwise, -1.

Instance memberInsert(index, header)

Inserts an existing header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
headerColumnHeaderThe ColumnHeader to insert into the collection.

Throws:

Instance memberInsert(index, text, width, textAlign)

Creates a new column header and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
textStringThe text to display in the header.
widthInt32The initial width of the header. Set to -1 to autosize the header to the size of the largest subitem text in the column or -2 to autosize the header to the size of the text of the header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.

Throws:

Instance memberInsert(index, text)

Creates a new column with the specified text, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
textStringThe text to display in the header.

Throws:

Instance memberInsert(index, text, width)

Creates a new header with the specified text and initial width, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
textStringThe text to display in the header.
widthInt32The initial width, in pixels, of the header.

Instance memberInsert(index, key, text)

Creates a new header with the specified text and key, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
keyStringThe name of the header.
textStringThe text to display in the header.

Instance memberInsert(index, key, text, width)

Creates a new column with the specified text, key, and width, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the header is inserted.
keyStringThe name of the header.
textStringThe text to display in the header.
widthInt32The initial width, in pixels, of the header.

Instance memberInsert(index, key, text, width, textAlign, imageKey)

Creates a new header with the specified aligned text, key, width, and image key, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the column header is inserted.
keyStringThe name of the header.
textStringThe text to display in the header.
widthInt32The initial width, in pixels, of the header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.
imageKeyStringThe key of the image to display in the header.

Instance memberInsert(index, key, text, width, textAlign, imageIndex)

Creates a new header with the specified aligned text, key, width, and image index, and inserts the header into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index location where the column header is inserted.
keyStringThe name of the header.
textStringThe text to display in the column header.
widthInt32The initial width, in pixels, of the header.
textAlignHorizontalAlignmentOne of the HorizontalAlignment values.
imageIndexInt32The index of the image to display in the header.

Instance memberRemove(column)

Removes the specified header from the collection.

ParameterTypeDescription
columnColumnHeaderA ColumnHeader representing the header to remove from the collection.

Instance memberRemoveAt(index)

Removes the header at the specified index within the collection.

ParameterTypeDescription
indexInt32The zero-based index of the header to remove.

Throws:

Instance memberRemoveByKey(key)

Removes the header with the specified key from the collection.

ParameterTypeDescription
keyStringThe name of the header to remove from the collection.

Events

Instance memberCollectionChanged

CollectionChangeEventHandler Fired when the collection changes.