NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

GridColumnsCollection Class

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

Remarks

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.

Requirements

Namespace: System.WinForms

Assembly: System.WinForms.dll

Example [Visual Basic]

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

See Also

GridColumnsCollection Members | System.WinForms Namespace | Add | DataColumn | DataGrid | DataGridBoolColumn | DataGridColumn | GridColumnsCollection | DataGridTextBoxColumn | Remove