Click here to Skip to main content
15,507,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a TextBox, Button and GridView.

User can enter the number in textbox and press ok buton. That many rows should get added to gridview. This much I achieved.

My issue is that if user wants to add some more rows below existing rows by clicking the same button again then all the existing data gets refreshed and fresh rows get added.

How to persist the same data and only new rows get added on the same button click?

Thanks in advance.
Posted
Updated 13-Jan-16 1:12am
v2
Comments
Sinisa Hajnal 13-Jan-16 6:11am    
You will have to show some code and explain a bit more. Do you mean: on button click, I add some table rows into the grid without saving them? Do you go to the server side (full page refresh)? Do you add the rows through ajax call? Also, what is wrong with data refresh? Is it simply the problem that people are typing in some data and it is not saved before they refresh?

If you're using GridView from asp.net there is an option to add/edit/delete single row as part of the control, no extra code is needed.
Sinisa Hajnal 13-Jan-16 6:13am    
You could try saving on button click BEFORE you add new ones

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