GridView CheckBox values lost

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a problem with web development, using gridview and checkbox.

My gridview has a few checkboxes, and I would retrieve the user modified
values on Save submission (button click). The problem is, consider the
example where I set the initial check value for them to be true (checked), on
execution, user untick them; but on save, the code-behind still sees the
checkboxes to assume the true value (rather than the new unchecked).

This happens either on using databinding, or programmatically assigning
true/false to the checkboxes on _RowDataBound.

Any idea?
 
Are you rebinding the grid within the Page_Load (or another event)
that fires before processing the results? The other thing I would
check... is EnableViewState enabled for the GridView?

Hope this helps!
-Damien
 
Hi Damien,

The grid does not get rebind at that moment, in fact, I had set a breakpoint
at the start of Page_Load, and at that point, the checkbox value has already
lost.

Yes, the grid has the EnableViewState to true.

Any idea?
Thanks

Eugene
 
Back
Top