View Single Post
 
Old May 2nd, 2014, 12:08 PM
shabnamzangeneh shabnamzangeneh is offline
Authorized User
Points: 82, Level: 1
Points: 82, Level: 1 Points: 82, Level: 1 Points: 82, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
Default Datagridview only shows empty tables!

Hi I am trying to apply your tyrit example in lesson 39 to my application. the problem is if I connect the datagridview to an empty table, it shows the column headers just fine, but if I connect it to a filled table, it gives the error that:
Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.DataGridViewCellEventArgs'.

The error occurs on the last line of this code:
Code:
        'Get the selected airplane
        Dim plane As Airplane =
        DirectCast(cmbLineNumberTo.SelectedItem, Airplane)

        'Display the airplane information
        dgvAPList.DataSource = plane.AirplaneStallAssignments
I appreciate your help!