I’ve got a string array like this:
string[] month = {"Month", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
I want to databind this to a dropdown.
I want the user to see these month names but when the user selects March (for example), I want to use the number 3 rather than “Mar”.
How can I do this?
Probably the quickest way to do this is just to make a list of key value pairs:
this was just coded up on the fly so excuse any little error in it. But it should give you a good idea of how to do what you want.