DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection Class

定义

表示在 DataGridView 中选择的单元格的集合。Represents a collection of cells that are selected in a DataGridView.

public ref class DataGridViewSelectedCellCollection : System::Windows::Forms::BaseCollection, System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class DataGridViewSelectedCellCollection : System.Windows.Forms.BaseCollection, System.Collections.IList
type DataGridViewSelectedCellCollection = class
    inherit BaseCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DataGridViewSelectedCellCollection
Inherits BaseCollection
Implements IList
继承
DataGridViewSelectedCellCollectionDataGridViewSelectedCellCollectionDataGridViewSelectedCellCollectionDataGridViewSelectedCellCollection
属性
实现

注解

不保证集合中单元格的顺序与选择它们的顺序一致。The order of cells in the collection is not guaranteed to match the order in which they were selected.

属性

Count Count Count Count

获取集合中元素的总数。Gets the total number of elements in the collection.

(Inherited from BaseCollection)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

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

(Inherited from BaseCollection)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

获取一个值,该值指示对 ICollection 的访问是否同步。Gets a value indicating whether access to the ICollection is synchronized.

(Inherited from BaseCollection)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取指定索引处的单元格。Gets the cell at the specified index.

List List List List

获取集合中元素的列表。Gets a list of elements in the collection.

SyncRoot SyncRoot SyncRoot SyncRoot

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

(Inherited from BaseCollection)

方法

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

清除集合。Clears the collection.

Contains(DataGridViewCell) Contains(DataGridViewCell) Contains(DataGridViewCell) Contains(DataGridViewCell)

确定指定的单元格是否包含在集合中。Determines whether the specified cell is contained in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

将当前一维 Array 的所有元素复制到指定的一维 Array 中(从指定的目标 Array 索引开始)。Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index.

(Inherited from BaseCollection)
CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32)

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

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
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()

获取能够循环访问集合成员的对象。Gets the object that enables iterating through the members of the collection.

(Inherited from BaseCollection)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell)

向集合中插入单元格。Inserts a cell into the collection.

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

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

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
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.Count ICollection.Count ICollection.Count ICollection.Count

获取集合中的元素数。Gets the number of elements in the collection.

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.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

返回一个可用于循环访问集合的枚举数。Returns an enumerator that can be used to iterate through the collection.

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

实现 Add(Object) 方法。Implements the Add(Object) method. 总是引发 NotSupportedExceptionAlways throws NotSupportedException.

IList.Clear() IList.Clear() IList.Clear() IList.Clear()

实现 Clear() 方法。Implements the Clear() method. 总是引发 NotSupportedExceptionAlways throws NotSupportedException.

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

确定指定的单元格是否包含在集合中。Determines whether the specified cell is contained in the collection.

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

返回指定单元格的索引。Returns the index of the specified cell.

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

实现 Insert(Int32, Object) 方法。Implements the Insert(Int32, Object) method. 总是引发 NotSupportedExceptionAlways throws NotSupportedException.

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

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

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

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

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

获取指定索引处的元素。Gets the element at the specified index.

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

实现 Remove(Object) 方法。Implements the Remove(Object) method. 总是引发 NotSupportedExceptionAlways throws NotSupportedException.

IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)

实现 RemoveAt(Int32) 方法。Implements the RemoveAt(Int32) method. 总是引发 NotSupportedExceptionAlways throws NotSupportedException.

扩展方法

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.

适用于

另请参阅