Link to home
Start Free TrialLog in
Avatar of Amandeep Singh Bhullar
Amandeep Singh BhullarFlag for India

asked on

How to use inserttemplate in gridview.

How to add new row in the gridview on the click of button that are also add in gridview.
Avatar of jagssidurala
jagssidurala
Flag of India image

DataTable dt = new DataTable();

get data and assign dt from database Then write below code

Gv.DataSource = dt;
Gv.DataBind();

I assumed dt is having two columns EmployeeId,EmployeeName.

In button click you need to write below code

dt.Rows.Add(0,"Jagssidurala");
Gv.DataSource = dt;
Gv.DataBind();
Hi ,
Try with sample in this url which would help you
http://www.dotnetspark.com/kb/643-how-to-editupdatedelete-gridview.aspx
Avatar of Amandeep Singh Bhullar

ASKER

I need to insert new row into the Grid
ASKER CERTIFIED SOLUTION
Avatar of Siyamala
Siyamala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think the code which i have written in first comment is exactly matches your need.