Question : How to clear a datagridview

Experts
I have a datagridview which is displaying data already by the following code.

private void show_valueInDGVItems()
        {
            Int32 CustomerID;
            CustomerID = Convert.ToInt32(label_Custmer_ID.Text);
            string query3 = "select * from Table_InvoiceItem WHERE CustomerID=@parameter1";
            using (SqlConnection con3 = new SqlConnection("Data source=INVENTOR-6FBADA\\SQLEXPRESS;Initial Catalog=AnindyaCD;Integrated Security=SSPI"))
            {
                using (SqlCommand cmd3 = new SqlCommand(query3, con3))
                {
                    cmd3.Parameters.AddWithValue("@parameter1", CustomerID);
                    using (SqlDataAdapter ad = new SqlDataAdapter(query3, con3))
                    {
                        ad.SelectCommand = cmd3;
                        DataSet ds = new DataSet();
                        ad.Fill(ds, "Table_InvoiceItem");
                        dataGridView_showItemtoSell.DataSource = ds.Tables[0];
                    }
                }
            }
        }
Now my question is how to clear the datagridview by a checkbox event of checkchanged.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
private void show_valueInDGVItems()
        {
            Int32 CustomerID;
            CustomerID = Convert.ToInt32(label_Custmer_ID.Text);
            string query3 = "select * from Table_InvoiceItem WHERE CustomerID=@parameter1";
            using (SqlConnection con3 = new SqlConnection("Data source=INVENTOR-6FBADA\\SQLEXPRESS;Initial Catalog=AnindyaCD;Integrated Security=SSPI"))
            {
                using (SqlCommand cmd3 = new SqlCommand(query3, con3))
                {
                    cmd3.Parameters.AddWithValue("@parameter1", CustomerID);
                    using (SqlDataAdapter ad = new SqlDataAdapter(query3, con3))
                    {
                        ad.SelectCommand = cmd3;
                        DataSet ds = new DataSet();
                        ad.Fill(ds, "Table_InvoiceItem");
                        dataGridView_showItemtoSell.DataSource = ds.Tables[0];
                    }
                }
            }
        }

Answer : How to clear a datagridview

Look in the conditional comment.

P.S. Normally the main stylesheet comes before the IE-only stylesheets.
1:
2:
3:
4:
5:
6:
7:
8:
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
Random Solutions  
 
programming4us programming4us