Can gridview retain it's data after postback

AlHal2
AlHal2 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2008

Commented:
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.

Author

Commented:
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.
Most Valuable Expert 2012
Top Expert 2008

Commented:
What are you doing with the table when the page posts back?
Commented:
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?

Author

Commented:
It works.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial