コード例 #1
0
        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var id = dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString();

            // delete product from chart
            cart.DeleteProductFromChart(id);
            // display Message
            MessageBox.Show("Prodcut Deleted");
            // clear grid
            dataGridView2.Rows.Clear();
            // load cart product
            QueryDataClass.LoadChartProduct(dataGridView2, textBox2);
        }
コード例 #2
0
        private void Checkout_Load(object sender, EventArgs e)
        {
            // load grid
            dataGridView2.ColumnCount         = 5;
            dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            // rows heading
            dataGridView2.Columns[0].Name = "Product Name";
            dataGridView2.Columns[1].Name = "Product Name";
            dataGridView2.Columns[3].Name = "Quantity";
            dataGridView2.Columns[2].Name = "Total Price";
            dataGridView2.Columns[4].Name = "DateAdded";
            // create button
            DataGridViewButtonColumn btn = new DataGridViewButtonColumn();

            btn.HeaderText = "Action";
            btn.Name       = "button";
            btn.Text       = "Delete Item ";
            btn.UseColumnTextForButtonValue = true;
            // add button
            dataGridView2.Columns.Add(btn);
            // load cart product
            QueryDataClass.LoadChartProduct(dataGridView2, textBox2);
        }
コード例 #3
0
 private void chartItem()
 {
     QueryDataClass.LoadChartProduct(dataGridView2, textBox2);
 }