---
title: "datagridview applied in c#"  
description: "datagridview applied in c#"  
author: "Kenny Tangnde"  
published: 2011-09-07  
updated: 2011-09-11  
canonical: https://www.mindstick.com/forum/303/datagridview-applied-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# datagridview applied in c#

hi all

datagridview the first one column is used ,ColumnType:[DataGridViewCheckBoxColumn](https://www.mindstick.com/forum/368/datagridviewcheckboxcolumn), I [now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now) think Achieve pressing the [command](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net) [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) all rows data.

thanks in advance.

## Replies

### Reply by Kenny Tangnde

hi Awadhendra Tiwari ,

thanks for your answer.

i very appreciate your bolg write article.\

thanks.

### Reply by Anonymous User

Hi,\

```
  private void button1_Click(object sender, EventArgs e)    {        List<DataGridViewRow> rows_with_checked_column = new List<DataGridViewRow>();        foreach (DataGridViewRow row in dataGridView1.Rows)        {            if (Convert.ToBoolean(row.Cells[CheckBoxColumn1.Name].Value) == true)            {                rows_with_checked_column.Add(row);            }        }        // Do what you want with the check rows    Thanks.
```

### Reply by Kenny Tangnde

Hi Awadhendra Tiwari,

yes,this is i want.

// the click command , i want select all Checking of checkbox column

private void btnSelectALL_Click(object sender, EventArgs e) \
{\
\
//how write the code\
}

thanks

### Reply by Anonymous User

Please check following link.\
\
http://www.mindstick.com/Articles/77b73daa-2307-4de6-91df-7d6fe1094731/?Checkbox in DataGridView\
\
[http://stackoverflow.com/questions/1237829/datagridview-checkbox-column-value-and-functionality](http://stackoverflow.com/questions/1237829/datagridview-checkbox-column-value-and-functionality)\
\
http://www.codeproject.com/KB/grid/CheckBoxHeaderCell.aspx\
\
May be this is what you want.\
\
Thanks.\

### Reply by Kenny Tangnde

hi all,

//code

/// <summary>\
/// this method select all datagridview row header, it is used for select all rows\
/// </summary>\
\
private void btnSelectALL_Click(object sender, EventArgs e)\
{\
// first column name is "Select"，ColumnType:DataGridViewCheckBoxColumn\
//how write the code\
}

### Reply by Kenny Tangnde

Sorry, my question may be not detailed enough\
How used dataGridView Control of ColumnType:DataGridViewCheckBoxColumn attribute

### Reply by John Smith

Please paste your code here..

### Reply by Anonymous User

Hi aken H,

Could you please explain your question in more detail. I could not get your question properly.

Thanks.


---

Original Source: https://www.mindstick.com/forum/303/datagridview-applied-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
