Represents a collection of TBD objects in the DataGrid control.
Object
BaseCollection
GridColumnsCollection
[Visual Basic] Public Class GridColumnsCollection Inherits BaseCollection [C#] public class GridColumnsCollection : BaseCollection [C++] public __gc class GridColumnsCollection : public BaseCollection [JScript] public class GridColumnsCollection extends BaseCollection
On the TBD control, you access the GridColumnsCollection through the GridColumns property.
The GridColumnsCollection uses standard Add and Remove methods as well as an All method to manipulate the collection. You can also use the Contains method to determine if a specific property value exists in the collection. Additionally, use the IndexOf method to determine the index of any DataGridColumn object within the collection.
Namespace: System.WinForms
Assembly: System.WinForms.dll
The following example references the TBD of a DataGrid control through its GridColumns property. Using the reference, the code prints the type of each DataGridColumn in the collection, and also the name of the TBD associated with the DataGridColumn.
[Visual Basic]
Private Sub GetGridColumns() Dim dgCols As GridColumnsCollection Dim dgCol As DataGridColumn ' Set the object variable to the collection. Set dgCols = DataGrid1.GridColumns ' Iterate through the collection and print each object's type and DataColumn name. For Each dgCol in DgCols Debug.Print dgCol.GetType.ToString, dgCol.DataColumn.ColumnName Next End Sub
GridColumnsCollection Members | System.WinForms Namespace | Add | DataColumn | DataGrid | DataGridBoolColumn | DataGridColumn | GridColumnsCollection | DataGridTextBoxColumn | Remove