What should i do? It doesnt add a row even if i already declare a new row.
//This is my behind codes in add button
DataTable dt = new DataTable();
DataRow dr = null;
dt.Columns.Add(new DataColumn("Column1", typeof(string)));
dt.Columns.Add(new DataColumn("Column2", typeof(string)));
dr = dt.NewRow();
dr["Column1"] = "";
dr["Column2"] = TextBox1.Text;
dt.Rows.Add(dr);
ViewState["CurrentTable"] = dt;
ListView1.DataSource = dt;
ListView1.DataBind();
//This is my layout code
|
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Chandan Prasad174 reputationPosted Sep 11, 2018, 6:35 PM EDT
Guest User27 reputationPosted Sep 11, 2018, 7:08 PM EDT