generate drop down list using array

hi experts,

lets say i wanna give grades for students, i need to generate a row of dropdown lists probably a,b,c,d, in each list. how do i do that? assume that student numbers of students are not fixed...

i was thinking alogrithm might be:
1) load names from data
2) place names into array
3) generate drop down lists on each name on each array

but how am i gonna generate the lists... with ,a,b,c,d in it?
Who is Participating?
YiogiConnect With a Mentor Commented:
Ok so you want to do the master detail grid I suppose. All you need is a datagrid, you can bind it to your data directly if its coming from a database. Then you create a key column for the master, a key for the detail record and add a relation between them to your datagrid.

That's all. See code below on how to create a relation taken from:
also you can see:

Or you can just google VB.Net datagrid with a master detail relation and get more examples. It's quite easy to do it.
Private Sub CreateRelation()
    ' Get the DataColumn objects from two DataTable objects in a DataSet.
    Dim parentCol As DataColumn
    Dim childCol As DataColumn
    ' Code to get the DataSet not shown here.
    parentCol = DataSet1.Tables("Customers").Columns("CustID")
    childCol = DataSet1.Tables("Orders").Columns("CustID")
    ' Create DataRelation.
    Dim relCustOrder As DataRelation
    relCustOrder = New DataRelation("CustomersOrders", parentCol, childCol)
    ' Add the relation to the DataSet.
End Sub

Open in new window

All you need is a combo box and specify the items collection adding there abcd. no need for any arrays.
aaxenAuthor Commented:
no i mean i need a number of students..... with a number of lists in each row of individual student.... the number of student isnt fixed....
Can you be a bit more specific on what exactly you want to do? It's still kind of vague to me. This is what I understand. You want to view some sort of a grid with a master detail relation. The individual students being the master records and the courses with their respective grades being the detail ones?

Or do you want to be able to select a student and then assign grades to him to the various courses he is taking?
aaxenAuthor Commented:
i want the program to generates a table with dropdown list in each cell. the table should be name/subject table. and each dropdown list has a,b,c,d.
All Courses

From novice to tech pro — start learning today.