I've got a gridview with a column of checkboxes. If I check off any
number of them, and perform a postback, they all go back to being
unchecked. What options do I have for getting around this?
Don't rebind the data in Page_Load every time. Use, for example, a If Not
Page.IsPostBack Then and only bind then. The viewstate is reconstituted
prior to Page_Load, so you will overwrite every time if you bind there.

Signature
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss
or just read it:
http://gregorybeamer.spaces.live.com/
*************************************************
| Think outside the box!
*************************************************
> I've got a gridview with a column of checkboxes. If I check off any
> number of them, and perform a postback, they all go back to being
> unchecked. What options do I have for getting around this?
Chris - 21 Mar 2008 18:15 GMT
Interesting, it seems that system.web.ui.webcontrols.button is the
culprit. If I put a 'select' control link in my gridview, that keeps
the checkboxes just fine. I wonder what the difference is?
> Don't rebind the data in Page_Load every time. Use, for example, a If Not
> Page.IsPostBack Then and only bind then. The viewstate is reconstituted
[quoted text clipped - 17 lines]
> > number of them, and perform a postback, they all go back to being
> > unchecked. What options do I have for getting around this?