bind text in c# xamarin code example

Example 1: winforms c# add data to datagridview with a button

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;
        }

Example 2: how to change text in richtextbox wpf

richTextBox1.Document.Blocks.Clear();
richTextBox1.Document.Blocks.Add(new Paragraph(new Run("Text")));