• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 735
  • Last Modified:

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.
0
Amandeep Singh Bhullar
Asked:
Amandeep Singh Bhullar
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
jagssiduralaCommented:
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();
0
 
SiyamalaCommented:
Hi ,
Try with sample in this url which would help you
http://www.dotnetspark.com/kb/643-how-to-editupdatedelete-gridview.aspx
0
 
Amandeep Singh BhullarAuthor Commented:
I need to insert new row into the Grid
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
SiyamalaCommented:
0
 
jagssiduralaCommented:
I think the code which i have written in first comment is exactly matches your need.
0
 
Amandeep Singh BhullarAuthor Commented:
Thanks
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now