I am creating a pageant scoring system.
I managed to display the field names from different tables :
The first column "Participants" is from Participant table and the succeeding columns is looped from the Criteria table.
This is the code:
Private Sub CreateDataEntry(ByVal CatID As Integer)
Me.CriteriaTableAdapter.FillByCategory(Me.PSSdbDataSet.Criteria, CatID)
DataGridView.Rows.Clear()
DataGridView.Columns.Clear()
' construct data entry
' first column (participants)
Dim nc As New DataGridViewTextBoxColumn
nc.Name = "Participants"
nc.Width = 250
nc.ReadOnly = True
DataGridView.Columns.Add(nc)
nc = Nothing
' succeeding columns (criteria)
For Each drCriteria As DataRow In Me.PSSdbDataSet.Criteria.Rows
nc = New DataGridViewTextBoxColumn
nc.Name = drCriteria("Cri_desc") & Chr(13) & drCriteria("Cri_percent") & "%"
nc.HeaderText = drCriteria("Cri_desc") & " " & drCriteria("Cri_percent") & "%"
nc.Width = 100
DataGridView.Columns.Add(nc)
Next
End Sub
Now, how can I fill the participant's row from the database? and the Criteria rows must be blank so I can input scores.. Thanks.
This must be the expected result: