Socarsky
Well-known member
- Joined
- Mar 3, 2014
- Messages
- 59
- Programming Experience
- Beginner
Thanks for pointing my wrong approach where was that. Now I've resolved my issue thanks to you.Maybe because you are creating new rows? (t.NewRow)
DataTable t = new DataTable(); a.Fill(t); DataColumn newCol = new DataColumn("NewColumn", typeof(string)); newCol.AllowDBNull = true; t.Columns.Add(newCol); foreach (DataRow row in t.Rows) { row["NewColumn"] = "With String"; } dataGridView1.DataSource = t;