Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 01, 2007 06:13 PM by DeskingFan
Oct 01, 2007 03:49 PM|LINK
I have a Master page and a content page. The content page contains a gridview that is databound from a Dictionary<key, myObject> collection. The 2nd column in the GridView control is an <asp:CheckBox ..> control. I select a few of the CheckBoxes and
click on a menu item to post, however every checkbox is returning false.
Here is the code that I use to iterate through the grid: Any suggestions are appreciated. Thanks.
//do something here
Oct 01, 2007 04:25 PM|LINK
Did you enable view state with enableViewState = true;
if you do...
Also, are you binding your data on every page load? This will re-populate your grid. You should only populate it on first page load
// Bind data to grid
Oct 01, 2007 04:27 PM|LINK
Is the checkbox bound to data somewhere? I haven't tried to use an unbound checkbox as a selector. Its possible that the order of events in ASP might be messing you up. But I think you may want to try creating an array to store your checkbox values and
update it on the checkbox's CheckChanged event. That way you take the order of event execution out of the equation.
Oct 01, 2007 06:13 PM|LINK
Thanks, I forgot to put the "if (!Page.IsPostback)" before before binding the GridView.