VB.Net DataViewGrid Problem

Posted on 2007-08-08
Last Modified: 2013-11-26
I am iterating through a grid to find out which rows have a checbox clicked (checkboxes are in column 1). They are all defaulted to clicked initially and I can unclick as many as i like. So for example if i unclick 2 out of eleven rows and hit the save button ,I am told that 10 rows are to be updated instead of 9. The last row unclicked is not recognised. Is there any way to update all the grid changes before hitting the save button.? Hope that makes sense.
Question by:Marias099
    LVL 39

    Accepted Solution

    try calling datagridview.endedit method before starting your save process.
    LVL 48

    Expert Comment

    Wath does your save button (code)?

    Author Comment

    The endedit method worked fine. Thanks.

    Expert Comment

    Dim ctlCheckbox as Control

    For Each GVR as GridViewRow In GV.Rows
      ctlCheckbox = GVR.Cells(1).Controls(1)
      If TryCast(ctlCheckbox,CheckBox).Checked Then
      End If
    LVL 48

    Expert Comment

    >> The endedit method worked fine. Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now