DataGridViewSelectedRowCollection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
[<System.ComponentModel.ListBindable(false)>]
type DataGridViewSelectedRowCollection = class
inherit BaseCollection
interface IList
interface ICollection
interface IEnumerable
Public Class DataGridViewSelectedRowCollection
Inherits BaseCollection
Implements IList
- Inheritance
- Attributes
- Implements
Remarks
The order of rows in the collection is not guaranteed to match the order in which they were selected.
Properties
| Name | Description |
|---|---|
| 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 |
Gets a value indicating whether access to the ICollection is synchronized. (Inherited from BaseCollection) |
| Item[Int32] |
Gets the row at the specified index. |
| List |
Gets the list of elements contained in the BaseCollection instance. |
| SyncRoot |
Gets an object that can be used to synchronize access to the BaseCollection. (Inherited from BaseCollection) |
Methods
| Name | Description |
|---|---|
| Clear() |
Clears the collection. |
| Contains(DataGridViewRow) |
Determines whether the specified row is contained in the collection. |
| CopyTo(Array, Int32) |
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. |
| GetEnumerator() |
Gets the object that enables iterating through the members of the collection. (Inherited from BaseCollection) |
| Insert(Int32, DataGridViewRow) |
Inserts a row into the collection at the specified position. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| 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) |
Implements the Add(Object) method. Always throws NotSupportedException. |
| IList.Clear() |
Implements the Clear() method. Always 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) |
Implements the Insert(Int32, Object) method. Always 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) |
Implements the Remove(Object) method. Always throws NotSupportedException. |
| IList.RemoveAt(Int32) |
Implements the RemoveAt(Int32) method. Always throws NotSupportedException. |