Disposes of the resources (other than memory) used by the DataGrid.
[Visual Basic] Overrides Public Sub Dispose() [C#] public override void Dispose(); [C++] public: override void Dispose(); [JScript] public override function Dispose();
Call Dispose when you are finished using the DataGrid. The Dispose method leaves the DataGrid in an unuseable state. After calling Dispose, you must release all references to the DataGrid so the memory it was occupying can be reclaimed by garbage collection.
The following example uses the Dispose method to free resources.
[Visual Basic]
Private Sub DisposeGridResources(ByVal myGrid As DataGrid) myGrid.Dispose Set myGrid = Nothing End Sub
DataGrid Class | DataGrid Members | System.WinForms Namespace