Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I add a new Row in a GridView to do?(By writing code).
by Language Vb in Asp.net.

[edit]Try to give your questions descriptive titles - it encourages those who might be able to help to read it, and doesn't waste the time of those who can't help. OriginalGriff[/edit]
Posted
Updated 23-Jun-10 8:09am
v3

first take a gridview in which you want to add new row.
then add a button to add new row like 'BtnAddNew'.

Dim tempdt As DataTable = Session("getds") 'the data shown in gridview'
tempdt.Rows.InsertAt(tempdt.NewRow, 0)' it will create new row at 0 index'
Session("getds") = tempdt
GridView1.DataSource = Session("getds")
Gridview1.EditIndex = 0
Gridview1.DataBind()
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900