DataGridViewSelectedRowCollection Class

Definition

表示在 DataGridViewRow 中选择的 DataGridView 对象的集合。Represents a collection of DataGridViewRow objects that are selected in a DataGridView.

public ref class DataGridViewSelectedRowCollection : System::Windows::Forms::BaseCollection, System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class DataGridViewSelectedRowCollection : System.Windows.Forms.BaseCollection, System.Collections.IList
type DataGridViewSelectedRowCollection = class
    inherit BaseCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DataGridViewSelectedRowCollection
Inherits BaseCollection
Implements IList
Inheritance
DataGridViewSelectedRowCollection
Attributes
Implements

Remarks

不保证集合中的行顺序与选择它们的顺序相匹配。The order of rows in the collection is not guaranteed to match the order in which they were selected.

Properties

Count

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

(Inherited from BaseCollection)
IsReadOnly

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

(Inherited from BaseCollection)
IsSynchronized

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

(Inherited from BaseCollection)
Item[Int32]

获取指定索引处的行。Gets the row at the specified index.

List

获取 BaseCollection 实例中包含的元素的列表。Gets the list of elements contained in the BaseCollection instance.

SyncRoot

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

(Inherited from BaseCollection)

Methods

Clear()

清除集合。Clears the collection.

Contains(DataGridViewRow)

确定指定的行是否包含在集合中。Determines whether the specified row is contained in the collection.

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(DataGridViewRow[], Int32)

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

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)

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

(Inherited from Object)
GetEnumerator()

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

(Inherited from BaseCollection)
GetHashCode()

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

(Inherited from Object)
GetLifetimeService()

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

(Inherited from MarshalByRefObject)
GetType()

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

(Inherited from Object)
InitializeLifetimeService()

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

(Inherited from MarshalByRefObject)
Insert(Int32, DataGridViewRow)

在集合中的指定位置插入一行。Inserts a row into the collection at the specified position.

MemberwiseClone()

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

(Inherited from Object)
MemberwiseClone(Boolean)

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

(Inherited from MarshalByRefObject)
ToString()

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

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32)

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

ICollection.Count

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

ICollection.IsSynchronized

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

ICollection.SyncRoot

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

IEnumerable.GetEnumerator()

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

IList.Add(Object)

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

IList.Clear()

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

IList.Contains(Object)

确定指定的值是否包含在集合中。Determines whether the specified value is contained in the collection.

IList.IndexOf(Object)

返回指定元素的索引。Returns the index of the specified element.

IList.Insert(Int32, Object)

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

IList.IsFixedSize

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

IList.IsReadOnly

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

IList.Item[Int32]

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

IList.Remove(Object)

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

IList.RemoveAt(Int32)

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

Extension Methods

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Applies to

See also