>>Hi everybody,
>>
>>I have a very strange problem. I added some code yesterday which worked in my tests
>>
>>protected void bntSavedApproved_Click(object sender, EventArgs e)
>> {
>> int PeopleApproved = 0;
>> for (int i = 0; i < this.ProfilesGrid.Rows.Count; i++ )
>> {
>> CheckBox chkbtnApproved = this.ProfilesGrid.Rows[i].FindControl("chkApproved") as CheckBox ;
>>
>> if (chkbtnApproved != null)
>> {
>> if (chkbtnApproved.Checked == true)
>> {
>> int RegID = (int)this.ProfilesGrid.DataKeys[i].Value ;
>> Util.RunStoredProc("SaveApprovedPerson", new System.Data.SqlClient.SqlParameter("RegistrationID", RegID));
>> PeopleApproved++;
>> }
>> }
>> }
>>
>>
>>Today I continued to work on this page, added one more control, etc. and for some reason it doesn't work anymore. I check the checkbox in the grid, but it doesn't go into chkbtnApproved.Checked = true anymore.
>>
>>Do you know what could be wrong?
>>
>>Thanks in advance.
>
>Is it because you are first checking chkbtnApproved != null rather than chkbtnApproved.checked != null ?
No, not because of that. There was something strange, with my colleague we closed almost all opened Windows, re-load VS and the code started to work again.
If it's not broken, fix it until it is.
My Blog