DataGridViewSelectedColumnCollection DataGridViewSelectedColumnCollection DataGridViewSelectedColumnCollection DataGridViewSelectedColumnCollection Class

Definition

Represents a collection of DataGridViewColumn objects that are selected in a DataGridView.

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

Remarks

The order of columns in the collection is not guaranteed to match the order in which they were selected.

The DataGridViewSelectedColumnCollection does not perform efficiently when working with large numbers of columns. Typically, DataGridView controls will not contain enough columns for this to be an issue, but if you are working with large numbers of columns, you can use the DataGridView.AreAllCellsSelected to determine if the entire grid is selected, or you can use the DataGridViewColumnCollection.GetColumnCount to determine the number of selected columns (or the number of columns in a specified state). For more information, see Best Practices for Scaling the Windows Forms DataGridView Control.

Properties

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

Gets a value indicating whether access to the ICollection is synchronized.

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

Gets the column at the specified index.

List List List List

Gets the list of elements contained in the BaseCollection instance.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object that can be used to synchronize access to the BaseCollection.

(Inherited from BaseCollection)

Methods

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

Clears the collection.

Contains(DataGridViewColumn) Contains(DataGridViewColumn) Contains(DataGridViewColumn) Contains(DataGridViewColumn)

Determines whether the specified column is contained in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) 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(DataGridViewColumn[], Int32) CopyTo(DataGridViewColumn[], Int32) CopyTo(DataGridViewColumn[], Int32) CopyTo(DataGridViewColumn[], Int32)

Copies the elements of the collection to the specified 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()

Gets 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, DataGridViewColumn) Insert(Int32, DataGridViewColumn) Insert(Int32, DataGridViewColumn) Insert(Int32, DataGridViewColumn)

Inserts a column into the collection at the specified position.

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

Creates a shallow copy of the current Object.

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

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)

Explicit Interface Implementations

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 iterates through a collection.

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

Implements the Add(Object) method. Always throws NotSupportedException.

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

Implements the Clear() method. Always throws NotSupportedException.

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

Determines whether the specified value is contained in the collection.

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

Returns the index of the specified element.

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

Implements the Insert(Int32, Object) method. Always 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)

Implements the Remove(Object) method. Always throws NotSupportedException.

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

Implements the RemoveAt(Int32) method. Always throws NotSupportedException.

Extension Methods

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

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(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)

Converts an IEnumerable to an IQueryable.

Applies to

See Also