DataGridViewComboBoxCell.ObjectCollection DataGridViewComboBoxCell.ObjectCollection DataGridViewComboBoxCell.ObjectCollection DataGridViewComboBoxCell.ObjectCollection Class

定义

表示 DataGridViewComboBoxCell 中的选项的集合。Represents the collection of selection choices in a DataGridViewComboBoxCell.

public: ref class DataGridViewComboBoxCell::ObjectCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class DataGridViewComboBoxCell.ObjectCollection : System.Collections.IList
type DataGridViewComboBoxCell.ObjectCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DataGridViewComboBoxCell.ObjectCollection
Implements IList
继承
DataGridViewComboBoxCell.ObjectCollectionDataGridViewComboBoxCell.ObjectCollectionDataGridViewComboBoxCell.ObjectCollectionDataGridViewComboBoxCell.ObjectCollection
属性
实现

注解

可以DataGridViewComboBoxCell.ObjectCollectionDataGridViewComboBoxCell.Items属性或DataGridViewComboBoxColumn.Items属性中检索对象。You can retrieve DataGridViewComboBoxCell.ObjectCollection objects from the DataGridViewComboBoxCell.Items property or the DataGridViewComboBoxColumn.Items property.

构造函数

DataGridViewComboBoxCell.ObjectCollection(DataGridViewComboBoxCell) DataGridViewComboBoxCell.ObjectCollection(DataGridViewComboBoxCell) DataGridViewComboBoxCell.ObjectCollection(DataGridViewComboBoxCell) DataGridViewComboBoxCell.ObjectCollection(DataGridViewComboBoxCell)

初始化 DataGridViewComboBoxCell.ObjectCollection 类的新实例。Initializes a new instance of the DataGridViewComboBoxCell.ObjectCollection class.

属性

Count Count Count Count

获取集合中的项数。Gets the number of items in the collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

获取一个值,该值指示集合是否为只读。Gets a value indicating whether the collection is read-only.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置当前索引位置的项。Gets or sets the item at the current index location. 在 C# 中,此属性是 DataGridViewComboBoxCell.ObjectCollection 类的索引器。In C#, this property is the indexer for the DataGridViewComboBoxCell.ObjectCollection class.

方法

Add(Object) Add(Object) Add(Object) Add(Object)

DataGridViewComboBoxCell 的项列表添加项。Adds an item to the list of items for a DataGridViewComboBoxCell.

AddRange(DataGridViewComboBoxCell+ObjectCollection) AddRange(DataGridViewComboBoxCell+ObjectCollection) AddRange(DataGridViewComboBoxCell+ObjectCollection) AddRange(DataGridViewComboBoxCell+ObjectCollection)

将现有 DataGridViewComboBoxCell.ObjectCollection 的项添加到 DataGridViewComboBoxCell 中项的列表中。Adds the items of an existing DataGridViewComboBoxCell.ObjectCollection to the list of items in a DataGridViewComboBoxCell.

AddRange(Object[]) AddRange(Object[]) AddRange(Object[]) AddRange(Object[])

DataGridViewComboBoxCell 的项列表添加一项或多项。Adds one or more items to the list of items for a DataGridViewComboBoxCell.

Clear() Clear() Clear() Clear()

清除集合中的所有项。Clears all items from the collection.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

确定指定项是否位于集合内。Determines whether the specified item is contained in the collection.

CopyTo(Object[], Int32) CopyTo(Object[], Int32) CopyTo(Object[], Int32) CopyTo(Object[], Int32)

将整个集合复制到现有对象的数组中,从该数组内的指定位置开始复制。Copies the entire collection into an existing array of objects at a specified location within the array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回可循环访问 DataGridViewComboBoxCell.ObjectCollection 的枚举数。Returns an enumerator that can iterate through a DataGridViewComboBoxCell.ObjectCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

返回集合中指定项的索引。Returns the index of the specified item in the collection.

Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

将一项插入集合中指定索引处。Inserts an item into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

从集合中移除指定的对象。Removes the specified object from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除指定索引处的对象。Removes the object at the specified index.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

从指定索引处开始,将集合中的元素复制到指定的数组。Copies the elements of the collection to the specified array, starting at the specified index.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示对集合的访问是否为同步的(线程安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取可用于同步对集合的访问的对象。Gets an object that can be used to synchronize access to the collection.

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

将对象添加到集合。Adds an object to the collection.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

获取一个值,该值指示集合是否具有固定大小。Gets a value indicating whether the collection has a fixed size.

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅