Mfwamba Tshimanga

Mfwamba Tshimanga

  • NA
  • 155
  • 44k

Making my textbox dynamically...

Nov 22 2014 11:28 AM
Hi!

I wrote theses codes to make a sum Datagrid column and showing the total in a textbox.
Its works smootly. But its doesnt work dynamically. The total happear in time when I close and  reopen it. Then how can I make this total showing dynamically on time.
Please have a look on my codes:


private void Bill_Activated(object sender, EventArgs e)
        {
            int sum = 0;
            for (int i = 0; i < dataGridView2.Rows.Count; ++i)
            {
                sum += Convert.ToInt32(dataGridView2.Rows[i].Cells[9].Value);
                totalbill.Text = " " + sum.ToString();
            }

Answers (10)