---
title: "how can I remove all rows of datagridview and datatable in c#?"  
description: "how can I remove all rows of datagridview and datatable in c#?"  
author: "Lady Bird Johnson"  
published: 2013-06-15  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1143/how-can-i-remove-all-rows-of-datagridview-and-datatable-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# how can I remove all rows of datagridview and datatable in c#?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances), \
how can I [remove](https://yourviews.mindstick.com/story/4554/8-harmful-weeds-to-remove-from-garden) all rows of [datagridview](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp) and [datatable in c#](https://www.mindstick.com/forum/12872/getting-count-of-all-repeated-rows-in-a-datatable-in-c-sharp)?\
Thanks in advance.

## Replies

### Reply by AVADHESH PATEL

Hi,\
Try this,\
For datagrideview:\
**dataGridView1.Rows.Clear();**\
For [datatable](https://www.mindstick.com/blog/195/datatable-in-ado-dot-net):\
**datatable.Rows.Clear();**


---

Original Source: https://www.mindstick.com/forum/1143/how-can-i-remove-all-rows-of-datagridview-and-datatable-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
