Name

DataGridColumnCollection

Synopsis

This is the collection of DataGridColumn objects in a DataGrid control. It is provided through the DataGrid.Columns property. You can use this collection to programmatically add or remove columns, but these changes will not be automatically persisted over postbacks because the DataGrid.Columns property is not stored in view state. This collection will only contain columns that have been added through templates, not automatically generated ones.

Public NotInheritable Class DataGridColumnCollection : Implements_
       ICollection, IEnumerable, System.Web.UI.IStateManager
' Public Constructors
   Public Sub New(ByVal owner As DataGrid, 
        ByVal columns As System.Collections.ArrayList) 
' Public Instance Properties
   Public ReadOnly Property Count As Integer Implements ICollection.Count 
   Public ReadOnly Property IsReadOnly As Boolean  
   Public ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized 
   Public Default ReadOnly Property Item(
        ByVal index As Integer) As DataGridColumn  
   Public ReadOnly Property SyncRoot As Object Implements ICollection.SyncRoot 
' Public Instance Methods
   Public Sub Add(ByVal column As DataGridColumn) 
   Public Sub AddAt(ByVal index As Integer, 
        ByVal column As DataGridColumn) 
   Public Sub Clear() 
   Public Sub CopyTo(ByVal array As Array, 
        ByVal index As Integer) Implements ICollection.CopyTo 
   Public Function GetEnumerator(
        ) As IEnumerator Implements IEnumerable.GetEnumerator 
   Public Function IndexOf( ByVal column As DataGridColumn) ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.