ListBox.ObjectCollection

Wisej.Web.ListBox ObjectCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

Represents the collection of items in a Wisej.Web.ListBox control.

public class ObjectCollection : IList, ICollection, IEnumerable

Properties

Count

Int32: Returns the number of items in the collection.

IsDirty

Boolean: Returns or sets the dirty state for the list. When true, the list of items must be sent back to the client.

IsNew

Boolean: Returns or sets the new state for the list. When true, the entire list is cleared and reloaded on the client.

IsReadOnly

Boolean: Returns a value indicating whether this collection can be modified.

Item(index)

Object: Retrieves the item at the specified index within the collection.

Throws:

Methods

Add(item)

Adds an item to the list of items for a ListBox.

Parameter
Type
Description

item

An object representing the item to add to the collection.

Returns: Int32. The zero-based index of the item in the collection.

Throws:

AddRange(items)

Adds a collection of items to the list.

Parameter
Type
Description

items

Collection of items to add to the list.

Throws:

Clear()

Removes all items from the ListBox.

ClearInternal()

Removes all the items from the list without checking for the data source binding.

ClearSelection()

Resets all selected items.

Contains(value)

Determines if the specified item is located within the collection.

Parameter
Type
Description

value

An object representing the item to locate in the collection.

Returns: Boolean. true if the item is located within the collection; otherwise, false.

Throws:

CopyTo(destination, index)

Copies the entire collection into an existing array of objects at a specified location within the array.

Parameter
Type
Description

destination

The object array to copy the collection to.

index

The location in the destination array to copy the collection to.

CreateItemElement(value, state)

Returns an instance of the Element wrapper class.

Parameter
Type
Description

value

Wrapped value.

state

Initial state.

Returns: Element.

FillItems(items)

Fills the collection items without checking the existence of the data source on the owner.

Parameter
Type
Description

items

Collection of items to add to the list.

GetEnumerator()

Returns an enumerator that can be used to iterate through the item collection.

Returns: IEnumerator. A IEnumerator that represents the item collection.

GetFirstSelectedIndex()

Returns the first selected element.

Returns: Int32.

GetItem(index)

Returns the element at the index.

Parameter
Type
Description

index

Returns: Element.

GetRealIndex(index)

Returns the real index in the collection accounting for the deleted items that have not been committed to the client yet.

Parameter
Type
Description

index

Returns: Int32.

GetSelected()

Returns the list of selected elements.

Returns: IEnumerable<Element>.

GetSelectedIndices()

Returns the indexes of the selected items.

Returns: Int32[].

IndexOf(value)

Retrieves the index within the collection of the specified item.

Parameter
Type
Description

value

An object representing the item to locate in the collection.

Returns: Int32. The zero-based index where the item is located within the collection; otherwise, -1.

Throws:

IndexOf(element)

Retrieves the index within the collection of the specified item.

Parameter
Type
Description

element

An object representing the item to locate in the collection.

Returns: Int32. The zero-based index where the item is located within the collection; otherwise, -1.

Throws:

Insert(index, item)

Inserts an item into the collection at the specified index.

Parameter
Type
Description

index

The zero-based index location where the item is inserted.

item

An object representing the item to insert.

Throws:

IsSelected(index)

Returns true if the item at the index is selected.

Parameter
Type
Description

index

Returns: Boolean.

OnCollectionChanged(action, element)

Fires the CollectionChanged event.

Parameter
Type
Description

action

One of CollectionChangeAction indicating the reason the collection has changed.

element

The element that was added or removed from the collection, or null.

Remove(value)

Removes the specified item from the ListBox.

Parameter
Type
Description

value

The Object to remove from the list.

RemoveAt(index)

Removes an item from the ListBox at the specified index.

Parameter
Type
Description

index

The index of the item to remove.

Throws:

  • ArgumentOutOfRangeException The index parameter was less than zero, or the index parameter was greater than or equal to the count of items in the collection.

Render()

Renders the list to the json definition for the client.

Returns: Object.

RenderSelected()

Renders the list of selected indexes.

Returns: Object.

SetItem(index, value)

Changes a single element in the list.

Parameter
Type
Description

index

Index of the item to change.

value

New item value.

SetSelected(index, selected)

Sets the selected state of the item at the index.

Parameter
Type
Description

index

Index of the item to select or unselect.

selected

New state of the item.

Returns: Boolean.

Sort()

Sorts the items by their value.

Events

CollectionChanged

CollectionChangeEventHandler Fired when the collection changes.

Inherited By

Name
Description

Represents the collection of items in a CheckedListBox.

Last updated

Was this helpful?