Cast from type 'DataRowView' to type 'Integer' is not valid.

I'm creating a contact management application based on the Taskvision model. I am running into one problem. I have a drop down that is supposed to display a contact group based on the selected value in the dropdown.

I run into a problem on this line:

Dim selectedProgram As Integer = CType(cbPrograms.SelectedValue, Integer)

In trying to figure out the solution I set the whole Sub identical to the Taskvision sub - which gets no issues from the debugger:

Dim selectedProject As Integer = CType(cbProjects.SelectedValue, Integer)

What am I missing?

Robert

[569 byte] By [codefund.com] at [2008-2-8]