| Hi Expert,
When i'm try to bind custom collection to data gridview and combo box i got above error.
Here is my code
Public Class RoleHeader
Public rolecode As String = String.Empty
Public roleDescription As String = String.Empty
End Class
Public Class RoleContainer
Public BusinessUnit As String
Public BusiessUnitName As String
Public Sub New()
listOfRoles = New List(Of RoleHeader)
End Sub
Public listOfRoles As List(Of RoleHeader)
End Class
After that i get all data from the database using this code
Private Sub SetInforToBusinessUnitGUI()
Dim listOfRoleContainers As List(Of RoleContainer) = DataBase.GetListOfBusinessContainers(ConfigurationManager.AppSettings("LocalConnection").ToString())
If listOfRoleContainers Is Nothing Then
Return
End If
If listOfRoleContainers(0).listOfRoles Is Nothing Then
Return
End If
Column7.DataSource = listOfRoleContainers(0).listOfRoles
' Column7.AutoComplete = True
dataGridViewDetail.DataSource = listOfRoleContainers
dataGridViewDetail.DataMember = "RoleContainer"
End Sub
It's say the Field called " roleDescription " does not exist.
DataGridview is just design in normal way.And i check name and datapropertyName is correct.
Thank you | |