HOW CAN I REMOVE ALL ROWS OF DATAGRIDVIEW AND DATATABLE IN C#?

Lady Bird Johnson

Total Post:20

Points:140
Posted by  Lady Bird Johnson
C# 
C#
 5850  View(s)
Ratings:
Rate this:
Hi Expert, 

how can I remove all rows of datagridview and datatable in c#?

Thanks in advance. 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: how can I remove all rows of datagridview and datatable in c#?

    Hi,


    Try this,

    For datagrideview:

    dataGridView1.Rows.Clear();

    For datatable:

    datatable.Rows.Clear();

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!