Check out example codes for "winforms c# add data to datagridview with a button". It will help you in understanding the concepts better.

Code Example 1

private void button1_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("column1");
            dt.Columns.Add("column2");
            dt.Columns.Add("column3");
            
            DataRow NewRow = dt.NewRow();
            NewRow[0] = "row1";
            NewRow[1] = "row2";
  			NewRow[2] = "row3";
            dt.Rows.Add(NewRow);
            dataGridView1.DataSource = dt;
        }

Learn ReactJs, React Native from akashmittal.com