title: Trying to dynamically add a button with a unique identity in DataGridView for each row
body: <p>I have been trying to do the said above things with this code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!this.IsPostBack)
      {
          //Populating a table from the database
          SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString());
          con.Open();
          SqlDataAdapter da = new SqlDataAdapter("Select * from tbluser", con);
          DataTable dt = new DataTable();
          da.Fill(dt);
          DataTable finaldt = new DataTable();
          foreach (DataColumn column in dt.Columns)
          {
              if (column.ColumnName == "user_name")
              {
                  finaldt.Columns.Add("Username", typeof(string));
              }else if (column.ColumnName == "first_name")
              {
                  finaldt.Columns.Add("First Name", typeof(string));
              }else if (column.ColumnName == "last_name")
              {
                  finaldt.Columns.Add("Last Name", typeof(string));
              }else if (column.ColumnName == "email")
              {
                  finaldt.Columns.Add("E-mail", typeof(string));
              }else if (column.ColumnName == "grade")
              {
                  finaldt.Columns.Add("Grade", typeof(string));
              }
          }
          finaldt.Columns.Add("Edit", typeof(Button));
          foreach (DataRow row in dt.Rows)
          {
              Button removalButton = new Button();
              removalButton.Text = "Remove";
              removalButton.ID = "remove_" + row["user_name"];
              removalButton.Click += new EventHandler(remove_student);
              finaldt.Rows.Add(row["user_name"], row["first_name"], row["last_name"], row["email"], row["grade"], removalButton);
          }
  
          GridView1.DataSource = finaldt;
          GridView1.DataBind();
  </code></pre>
  
  <p>Near the bottom where I am adding rows to "finaldt", I am not sure this logic is completely valid for trying to set up a column for buttons with the</p>
  
  <pre><code>finaldt.Columns.Add("Edit", typeof(Button));
  </code></pre>
  
  <p>line.  Should I be doing something differently here?</p>