Link to home
Start Free TrialLog in
Avatar of zipnotic
zipnoticFlag for United States of America

asked on

Why am I getting false positives on my WinForms 2015?

Testing for dataset changes on form closing in WinForms 2015.

   
    If DS.HasChanges Then
            ChangesMade = True
             'Call Option to save code
        End If
        For Each dr As DataRow In DS.Tables("tCARDS").Rows
            If dr.RowState <> DataRowState.Unchanged Then
                ChangesMade = True

            End If
            If dr.HasVersion(DataRowVersion.Proposed) Then
                ChangesMade = True
            End If
        Next

Open in new window

The trouble is that when the user moves between datarows using a datagridview or bindingnavigator the Dataset is marked as changed.  It also shows the rowstate as being modified when it isn't.  The user isn't changing anything just navigating amongst records.  I'd like to figure out how to check for any true changes rather then getting the false positive?

Any ideas?


Thanks
Avatar of Kyle Santos
Kyle Santos
Flag of United States of America image

Hi,

I am following up on your question.  Do you still need help?

If you solved the problem on your own, would you please post the solution here in case others have the same problem?

Regards,

Kyle Santos
Customer Relations
Avatar of zipnotic

ASKER

I left the program without an auto save notify feature.  The only work around I could think of was to manually track changes by cloning the dataset and looping the rows comparing to the original dataset to see if there changes.  Seemed like a lot of work for a fairly common feature in programs.  Especially when it would seem like there is already a simple method to do so.  

In the end it just wasn't feasible for this program and nobody piped up with thoughts so yeah, if you have any ideas I would still like to implement this in future programs?

Thanks!

Zip
Hi Zip,

Thank you for letting me know.

I have the ability to send out alerts to more experts.  Would this be helpful?
Yes, that would be helpful.  I'd like to implement this functionality in future apps.
ASKER CERTIFIED SOLUTION
Avatar of zipnotic
zipnotic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial