Marvin kakuru

Marvin kakuru

  • 1.3k
  • 324
  • 155k

Adding line to datagridveiw from textbox

Jul 29 2011 5:19 AM
hi there,
your all ok i hope. Gat stuck been trying to add lines to my datagridview from various textboxes. just like you add an item to a shoping basket, but every time i click my button i only replace what i had already entered with what is in my textboxes.

any help below is the code i am using


}
DataTable dt = new DataTable();
dt.Columns.Add = ("DAY",typeof(string));
DataRow DR = dt.NewRow();
DR["Day"] = textbox1.Text.Tostring();
dt.Rows.Add(DR);
dataGridView1.Datasource=dt;
}

thanks

Answers (4)