I have a datagridview control in a tab page. Data on the dgv is populated by the datasource in the Windows VB.Net application and the datasource reloads itself on that tab page "on enter" event . There are several tab pages in the main form and I designed an "Exit" button in the main form to close the application completely. Problem is system crashed (not happen regularly but randomly, most likely after I sorted/filtered the column in the dgv or clicked on a row in dgv, but not always. ) when the focus is on the tab page with the datagridview control and exit out of the application. It pops up a datagridview error dialogue saying: "System.Windows.IndexOutOfRange....blah, blah, blah at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)...blah, blah" What is this exception? What have I done wrong in the application exit, it is just a simple line of code as follows: Private Sub btn_Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Exit.Click Me.Close() End Sub Thanks