datagridview the first one column is used ,ColumnType:DataGridViewCheckBoxColumn, I now think Achieve pressing the command button select all rows data.
privatevoid button1_Click(object sender,EventArgs e) { List<DataGridViewRow> rows_with_checked_column =newList<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
/// <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 }
Kenny Tangnde
11-Sep-2011hi Awadhendra Tiwari ,
thanks for your answer.
i very appreciate your bolg write article.
thanks.
Anonymous User
08-Sep-2011Kenny Tangnde
08-Sep-2011Hi 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
Anonymous User
08-Sep-2011http://www.mindstick.com/Articles/77b73daa-2307-4de6-91df-7d6fe1094731/?Checkbox in DataGridView
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.
Kenny Tangnde
07-Sep-2011hi 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
}
Kenny Tangnde
07-Sep-2011How used dataGridView Control of ColumnType:DataGridViewCheckBoxColumn attribute
John Smith
07-Sep-2011Anonymous User
07-Sep-2011Hi aken H,
Could you please explain your question in more detail. I could not get your question properly.
Thanks.