DataGridColumnCollection::Clear Method ()

 

Removes all DataGridColumn-derived column objects from the DataGridColumnCollection collection.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
void Clear()

Use this method to remove all DataGridColumn-derived column objects from the DataGridColumnCollection collection.

System_CAPS_noteNote

The Count property is automatically set to 0 after this method is used.

The following code example demonstrates how to use the Clear method to empty the DataGridColumnCollection collection before adding new columns to the collection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: