I have a dropdown getting populated by fetching a query on the database.
Say it fetches items given as follows:
Teacher,
Student,
Pricipal,
Sweeper,
FinanceManager.
While showing it in the dropdown, I wish to show it in the following order:
Principal,
FinanceManager,
Teacher,
Student,
Sweeper.
This isn’t any specific order (ascending or descending), but just a order that has some relevance according to the personalities.
How do I acheive ?
Since you fetching the data from database,the easy solution to me is adding a extra column to the same table which hold order.
So you can order by the DisplayOrder when you do the selection