Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have created a template field and inserting a checkbox into the field. I have name the checkbox as: "chkReceipient". I am trying to loop through the grid and check the checkbox in each row to determine if it is checked or not. If the checkbox is checked do something with that row, otherwise move on to the next row.

 

Here is my code:

For inti = 0 To GridView1.Rows.Count - 1
           Dim rowCheckBox As CheckBox = GridView1.Rows(inti).FindControl("chkReceipient")

           If rowCheckBox.Checked = False Then
               dstMembers.Tables("dstMembers").Rows.Add(myRow)
           End If
       Next

 

The problem that I am having is that the rowCheckBox.Checked is returning the value "False" in all cases evenwhen I check the checkbox.

 

Any suggestions?

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted

Problem solved, never placed the code that was called during the page load in an if not page.ispostback statement. Off to hang my head in shame...

 

Mike55

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...