How to clear datagridview all rows and columns


How to clear datagridview all rows and columns

Hi,

There is two methods to clear

DataGridview

all contents.

First method



1.Datagridiview1.rows.clear()

2.Datagridview1.columns.clear()


Second Method



It will clears all contents and also "datasource".

Datagridview.datasource=nothing()


Regards
Narayana


Comments

Author: Devesh Kumar13 Aug 2010 Member Level: Gold   Points : 0

DataGrid.Datasource=null;



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: