asp.net.ph

DataGridColumnCollection.Clear Method

System.Web.UI.WebControls Namespace   DataGridColumnCollection Class


Removes all DataGridColumn objects from the collection.

[ VB ]
Public Sub Clear ( )

[ C# ]
public void Clear ( );

[ C++ ]
public: void Clear ( );

[ JScript ]
public function Clear ( );

Remarks

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

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

Example

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

void Page_Init ( Object src, EventArgs e ) {
   myGrid.Columns.Clear ( );
   ...
}
  C# VB

See Also

DataGridColumnCollection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph