Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataview on Custom Dataset - Scope Issue

Status
Not open for further replies.

SonOfZeus

Programmer
Mar 6, 2002
53
CA
I've created a custom dataset holding a table Bid_Items (Holding Bid_ID, ITem_ID, Item_Description) populated using a dataadapter and a select statement. I then take this dataset and create 2 views which I then have to bind to different grids. Doing the bind itself seems to be find, but when I go to edit a record, the grid has it's data reset to empty. If I reselect that bid from a pulldown and hit a button that recalcs the datagrids it goes into edit mode in the right place. How do I get the dataview to keep it's data in a scope such that the edit action redoes the databind it has actual data to rebind?
 
Put the dataset into session. Postbacks will otherwise make the dataset disappear. You will also need to rebind on basically any event that causes a postback.

I struggled with this with datagrids for a bit. Very frustrating, I know.
 
evaleah
What would be advisable ,would session be ok...
or is it better to use the Viewstate["dataGridName"]= dgrig

Since Viewstate maintains itself during postback.

Any ideas about which could be better.

TIA

Parchure Nikhil

 
I prefer session state myself. I have found viewstate to be not all that dependable. Things seem to get lost.

But, I would say this is really just a matter of preference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top