Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to use inserttemplate in gridview.

Posted on 2010-09-22
8
Medium Priority
?
732 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
Siyamala earned 1000 total points
ID: 33733239
0
 
LVL 41

Assisted Solution

by:guru_sami
guru_sami earned 1000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

971 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