Saving Viewstate in a Gridview

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
I'm having some mental block here that is keeping me from being able to save viewstate in a gridview.

I'm using templates, and I've got a textbox on each row that should allow the user to enter some data.* Then, once they hit 'commit', I validate the data, and set another label on that row to 'valid/invalid' depending on the data.

The problem is, though, that I can't seem to figure out how to keep what they entered in that original text box.

Originally, I was trying to use a CustomValidator to serverside validate the code, but it was never showing 'invalid' and I suspect it is for the same reason.*

Is there some trick to forcing a gridview to keep the viewstate of it's controls?* My current solution is to save off the data when a postback occurs and reload it when the row is databound, but it feels klunky to me.



More...

View All Our Microsft Related Feeds
 
Back
Top