Solved

How to use inserttemplate in gridview.

Posted on 2010-09-22
8
725 Views
Last Modified: 2013-12-16
How to add new row in the gridview on the click of button that are also add in gridview.
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 12

Expert Comment

by:jagssidurala
ID: 33732584
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
 
LVL 5

Expert Comment

by:Siyamala
ID: 33732888
Hi ,
Try with sample in this url which would help you
http://www.dotnetspark.com/kb/643-how-to-editupdatedelete-gridview.aspx
0
 
LVL 19

Author Comment

by:Amandeep Singh Bhullar
ID: 33733153
I need to insert new row into the Grid
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 5

Accepted Solution

by:
Siyamala earned 250 total points
ID: 33733239
0
 
LVL 5

Expert Comment

by:Siyamala
ID: 33733254
0
 
LVL 41

Assisted Solution

by:guru_sami
guru_sami earned 250 total points
ID: 33736206
0
 
LVL 12

Expert Comment

by:jagssidurala
ID: 33766727
I think the code which i have written in first comment is exactly matches your need.
0
 
LVL 19

Author Closing Comment

by:Amandeep Singh Bhullar
ID: 33814477
Thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question