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!

DataGrid.CurrentGridTable

Gets the data table of the displayed grid.

[Visual Basic]
Public ReadOnly Property CurrentGridTable As DataGridTable
[C#]
public DataGridTable CurrentGridTable {get;}
[C++]
public: __property DataGridTable* get_CurrentGridTable();
[JScript]
public function get CurrentGridTable() : DataGridTable;

Property Value

A DataGridTable that represents the current table.

Remarks

Use the CurrentGridTable property to return a DataGridTable that contains the collection of DataGridColumn objects for the currently displayed table. Other DataGridTable objects are available through the GridTablesCollection, accessed through the GridTables property.

To change values in the DataGrid, use the DataTable returned by the DataGridTable object. The DataTable contains collections of columns and rows that contain the data displayed by the DataGrid.

Example [Visual Basic]

The following example prints the values of each row in a DataGrid control by accessing the underlying DataTable and its collection of DataRow objects.

[Visual Basic]

Private Sub PrintAllRowValues()
   Dim dt As DataTable
   Set dt = DataGrid1.CurrentGridTable.DataTable
   Dim row As DataRow
   Dim col As DataColumn
   For Each row In dt.Rows
      For Each col in dt.Columns
         Console.WriteLine(row(col))
      Next
   Next
End Sub

See Also

DataGrid Class | DataGrid Members | System.WinForms Namespace | DataColumn | DataGridTable | GridTablesCollection | DataTable | DataRow