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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.