DataTable detect column changed using ColumnChanged event

Background

Because of disconnected nature of VB.Net databinding I have users who have come from MS Access instant save who in .Net are concerned that they fogot to press save. Hence I added CheckForChangesAndPromptForSave. However this is firing too much. I have too much code and something must be changing a column but need to detect which and probably stop changing it.

Solution

Open Dataset and select table with changes. View Code. This generates new code window if not present. On table event use the ColumnChanged event.

Partial Class dsBusiness
    Partial Class QuoteDataTable

        Private Sub QuoteDataTable_ColumnChanged(sender As Object, e As System.Data.DataColumnChangeEventArgs) Handles Me.ColumnChanged
            MsgBox(e.Column.ColumnName)
        End Sub

    End Class
End Class
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: