Solved

Can gridview retain it's data after postback

Posted on 2014-02-26
5
258 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
Comment Utility
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
Comment Utility
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
Comment Utility
What are you doing with the table when the page posts back?
0
 

Accepted Solution

by:
AlHal2 earned 0 total points
Comment Utility
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
Comment Utility
It works.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now