AlHal2
asked on
Can gridview retain it's data after postback
This question is based on https://www.experts-exchange.com/questions/28373722/Updating-a-gridview-from-different-sources.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
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
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.
ASKER
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.
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.
What are you doing with the table when the page posts back?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works.