Hi to everybody,
Can anybody tell me if it's possible to use ajax toolkit to add a new blank row into a datagrid?
Thank you!
Add blank row in datagrid using AJAX
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Raj KumarRank #25 · 44.2K reputationPosted Jun 1, 2008, 7:36 PM EDT
private void Button2_Click(object sender, System.EventArgs e)
{
DataTable dt = (DataTable)Session["dt"];
DataRow row;
row = dt.NewRow();
row.ItemArray = dt.Rows[0].ItemArray;
row["EmployeeID"]=DBNull.Value ;
row["firstname"]="";
row["LastName"]="";
row["HomePhone"]="";
row["Title"]=System.DBNull.Value ;
row["TitleOfCourtesy"]=System.DBNull.Value ;
row["BirthDate"]=System.DBNull.Value ;
row["HireDate"]=System.DBNull.Value ;
row["Address"]=System.DBNull.Value ;
row["City"]=System.DBNull.Value ;
row["Region"]=System.DBNull.Value ;
row["PostalCode"]=System.DBNull.Value ;
row["Country"]=System.DBNull.Value ;
row["Extension"]=System.DBNull.Value ;
row["Photo"]=System.DBNull.Value ;
row["Notes"]=System.DBNull.Value ;
row["ReportsTo"]=System.DBNull.Value ;
row["PhotoPath"]=System.DBNull.Value ;
dt.Rows.Add(row);
dt.AcceptChanges();
DataGrid1.DataSource=dt;
DataGrid1.DataBind();
Session["dt"]=dt;
}
menelaussa menelaussa14 reputationPosted Jun 1, 2008, 11:43 PM EDT
Thank you!
I've tested and it's working!
Br