private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { // Process for UI control "" if (dataGridView1.CurrentRow != null) { int index = dataGridView1.CurrentRow.Index; //Console.WriteLine("Size: " + index); DataGridViewRow dgvRow = dataGridView1.CurrentRow; if (dgvRow.Cells["dgvtxtSoLuong"].Value != null && dgvRow.Cells["dgvcbcSach"].Value != null) { //Console.WriteLine("Value: " + Convert.ToString(dgvRow.Cells["dgvcbcSach"].Value)); dataGridView1.Rows[index].Cells["dgvtxtThanhTien"].Value = Convert.ToInt32(dgvRow.Cells["dgvtxtSoLuong"].Value) * bus_Sach.getGiaSach(Convert.ToString(dgvRow.Cells["dgvcbcSach"].Value)); } SumMoney(); } }