0

I've a table like this: Dim Classifica_Table() As Team_Data

I want to order the table in alphabet mode, in particular, this table contains all team of a championship grabbed by webpage.

This value are inserted in a Combobox:

For Each Team As Team_Data In Classifica_Table
        ComboBox1.Items.Add(Team.Name) 'Populate Combo Boxes with team names
    Next

but the order isn't good for me, so I want sort in alphabet. How can I do this? I tried with Classifica_Table.Sort() but seems doesn't working, the compiler tells me: that nothing Sort() accept this argument number.

1 Answer 1

1

You could use the IEnumerable extension OrderBy

For Each Team As Team_Data In Classifica_Table.OrderBy(Function(x) x.Name)
    ComboBox1.Items.Add(Team.Name) 
Next

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.