Solved

Can gridview retain it's data after postback

Posted on 2014-02-26
5
263 Views
Last Modified: 2014-03-25
This question is based on http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_28373722.html

I press a button to populate a gridview.  When I press the button again with different parameters, I want the new results to be added as an extra row to the gridview.  I don't want the new results to replace the old.

The gridview is populated by passing parameters to a stored procedure.  Obviously only one set of parameters can be passed at a time.

I'm using vb2008 with asp.net 3.5
0
Comment
Question by:AlHal2
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39892390
What are you using for the data source for the GridView?  If you are using something like the SqlDataSource, then it gets to be challenging.  If you are binding to a list structure or DataTable, then it should be easier.
0
 

Author Comment

by:AlHal2
ID: 39893147
I think I've solved the problem.
I've had a table created which will store the data that gets sent to the gridview.  The stored procedure updates the table and then runs a select query which is sent to the gridview.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39893304
What are you doing with the table when the page posts back?
0
 

Accepted Solution

by:
AlHal2 earned 0 total points
ID: 39894277
I've incorporated JamesBurger's solution to http://www.experts-exchange.com/Programming/Languages/.NET/Q_28375965.html

The stored procedure does what's necessary then displays the updated table.
That seems to work.
On the other post you talke about some database operations being synchronous, but not all.  Please could you elaborate?
0
 

Author Closing Comment

by:AlHal2
ID: 39952688
It works.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 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