Well, thanks again for the prompt answer.
I have another one.
Before assigning the collection to the drop down, I want it sorted. I wrote the following code:
// Declare User collection:
CollectionClasses.UserCollection all = new CollectionClasses.UserCollection();
// populate it:
all.GetMulti(null);
// now the sort:
all.SupportsSorting = true;
// line bellow does not work:
//all.Sort((int)UserFieldIndex.UserId, System.ComponentModel.ListSortDirection.Ascending);
// this does:
all.Sort(1, System.ComponentModel.ListSortDirection.Ascending);
I converted UserFieldIndex.UserId to int because if I let it be like in the documentation ("How do I sort a filled entity collection?") I get this error Cannot convert UserFieldIndex to int. I noticed that the complier does not mention UserFieldIndex.UserId but only UserFieldIndex. The value of UserFieldIndex.UserId should be 1.
Now, both lines above compile without error, but only the second actually sorts.
What did I do wrong?