Jump to content
  • Advertisement
Sign in to follow this  
aKa Davi

[web] Grid View Row Loop Testing Checkbox Checked

This topic is 4276 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, In ASP.NET im using a GridView to display data from a oracle stored procedure. I have added a column to teh start of the gridview, and added a checkbox. The aim is that the user will check all the enquiries that they wish to include within the XML file. here is my code (im jst using msgbox's to debug whether or not the form is working properly)
Dim dr As GridViewRow

        For Each dr In UnBatchedEnquiries.Rows
            Dim RowCheckBox As System.Web.UI.WebControls.CheckBox = dr.FindControl("RowCheckBox")
            If RowCheckBox.Checked = True Then
                MsgBox("Is Checked")
            End If

---This is my GridView--- <asp:GridView ID="UnBatchedEnquiries" runat="server" Width="100%"> <Columns> <asp:TemplateField HeaderText="IncludeEnquiry" > <HeaderTemplate>Include?</HeaderTemplate> <ItemTemplate> <asp:CheckBox id="RowCheckBox" runat="server"></asp:CheckBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> But for some reason this code isnt working. Does anyone know why?

Share this post

Link to post
Share on other sites
Hey i found why i was having the problem i was, it was to do with the form postback
i found a forumnpost that was having the exact same problem and this was the solution

in your Page_Load function

If Not (Page.IsPostBack) Then

'Your Bind Data Function


End If

Thanks for all your help =]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!