Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Programmatically Adding a Cell to DataGridView

$
0
0

I would like to add a Cell to a DGV automatically after the value has been generated.

I Got to here but it is not working:

foreach (Customer.Name in CustomerTable)
                {
                    i = 0;

                    Double X1 = Convert.ToDouble(DGV_Points.Rows[i].Cells[6].Value);
                    Double X2 = Convert.ToDouble(DGV_Points.Rows[i++].Cells[6].Value);

                    Double LapLength = X1 - X1;

                    this.DGV_Points.Rows.Add();
                    this.DGV_Points.Rows[0].Cells[1].Value = LapLength;
                    this.DGV_Points.Rows[1].Cells[1].Value = LapLength;
                }

Could someone please explain to me what's wrong?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>