Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use inserttemplate in gridview.

Posted on 2010-09-22
8
Medium Priority
?
730 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

688 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