Hi

I have populated the values to datagridview and i have kept checkbox for selecting a row.my question is how to select a particular row programatically so that i can delete only that particular row.i am waiting for the reply.

thank u

You need to iterate through each rows of your datagridview. Then need to check the value of particular cells where you have check box. So your code may looks like below...

foreach (DataGridViewRow row in dataGridView1.Rows)
{
     if(bool.Parse(row.Cells["yourcheckbox columnname"].Value.ToString()))
     {
          //code to delete selected row
     }
}

try with this and let us know...

Hi

I have populated the values to datagridview and i have kept checkbox for selecting a row.my question is how to select a particular row programatically so that i can delete only that particular row.i am waiting for the reply.

thank u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.