I need some help with using nested grids, I am having a hard time trying to figure them out. Below is the code that I am currently using:
Dim myDB As New DBAccess
If myDB.Connect(\"MRCS\") = False Then
Exit Sub
Else
Dim myDA As New OleDb.OleDbDataAdapter(\"spQryParentComments\", myDB.myConn)
myDA.TableMappings.Add(\"Table\", \"Original\")
myDA.SelectCommand.CommandType = CommandType.StoredProcedure
myDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter(\"@projName\", OleDb.OleDbType.VarChar)).Value = MRCSData.Instance.ProjectName
Dim myDS As New DataSet(\"Original\")
myDA.Fill(myDS)
Dim myChildDA As New OleDb.OleDbDataAdapter(\"spQryChildComments\", myDB.myConn)
myChildDA.TableMappings.Add(\"Table\", \"History\")
myChildDA.SelectCommand.CommandType = CommandType.StoredProcedure
myChildDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter(\"@projName\", OleDb.OleDbType.VarChar)).Value = MRCSData.Instance.ProjectName
myChildDA.Fill(myDS)
Dim parentColumn As DataColumn = myDS.Tables(\"Original\").Columns(\"commID\")
Dim childColumn As DataColumn = myDS.Tables(\"History\").Columns(\"commID\")
Dim relation As DataRelation = New System.Data.DataRelation(\"NumbersConnections\", parentColumn, childColumn)
myDS.Relations.Add(relation)
myDB.DisConnect()
Me.lstReviewComm.Rows.Items.Clear()
Me.lstReviewComm.Rows.DataSource = myDS
Me.lstReviewComm.Rows.DataMember = \"Original\"
Me.lstReviewComm.Focus()
End If
However it does not display the data correctly, please see the attached image.
Any help whould be appreshaited.
Thanks in advance
Simon