Sponsored By
MindStick Cleaner
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> .Net >> C# >> datagridview applied in c#
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
datagridview applied in c#
Posted On: 9/7/2011 9:41:56 AM

hi all

   datagridview the first one column  is used  ,ColumnType:DataGridViewCheckBoxColumn, I  now think Achieve  pressing the command button select all rows data.

thanks in advance.

Author Post

Awadhendra Tiwari


Total Post: 126
Member Since: 1/19/2011
Points: 893
Re: datagridview applied in c#
Posted On: 9/7/2011 9:48:02 AM

Hi aken H,

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

Thanks.

Author Post

John Smith


Total Post: 51
Member Since: 9/27/2010
Points: 332
Re: datagridview applied in c#
Posted On: 9/7/2011 10:02:23 AM
Please paste your code here..
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
Re: datagridview applied in c#
Posted On: 9/7/2011 10:02:54 AM
Sorry, my question may be not detailed enough
How used dataGridView Control of ColumnType:DataGridViewCheckBoxColumn attribute
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
Re: datagridview applied in c#
Posted On: 9/7/2011 10:14:11 AM

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
        }

Author Post

Awadhendra Tiwari


Total Post: 126
Member Since: 1/19/2011
Points: 893
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
Re: datagridview applied in c#
Posted On: 9/8/2011 2:33:02 AM

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

Author Post

Awadhendra Tiwari


Total Post: 126
Member Since: 1/19/2011
Points: 893
Re: datagridview applied in c#
Posted On: 9/8/2011 7:07:08 AM
Report Abuse Answer
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.
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
Re: datagridview applied in c#
Posted On: 9/11/2011 3:59:22 AM

hi Awadhendra Tiwari ,

     thanks for your answer.

i very  appreciate your bolg write article.

thanks.

Report Abuse Form
Reason:    
 
Total Online Users: 6803
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2009 - 2013MindStick. All Rights Reserved.