Solved

How to use inserttemplate in gridview.

Posted on 2010-09-22
8
723 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

786 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