I guess I'm lazy.. I thought there must be a package out there for this, but I can't find one. Anybody else know of a premade dropdown datatype listing U.S. states?
At least you admit you're being lazy. ;-) I was curious to see if the U.S. States existed as a list in the .NET framework (similar to how countries are listed in the System.Globalization namespace) ... but alas it's not there!
So using the super cool 'AbstractDataEditor', I've coded one up for you!
Hi, just a thought, but would an Enum of US states also be useful within any .net code ? if so (it's also less code) could just define an Enum and use the Enum DropDownList datatype.
Yeah, It's for v7
Let me try this as solution, but how can I implement this with class I dont want to use models, controllers.. I just want to find a way to use with some .cs file in which will be placed all states, and after that I need to render the state in a view (partial or just razor view).
Any help ?
Okey, I try this but only I get is a full dropdown in backoffice, and I want to show that on front. (in view or in partial view)
I try everything but no success. First I create Data Type and config the nuPicker as is shown on link. After that I could see all values in dropdown (backoffice). I add a composition with this data type and I want to show it on view as I told before.
Dropdown Datatype with list of U.S. States?
I guess I'm lazy.. I thought there must be a package out there for this, but I can't find one. Anybody else know of a premade dropdown datatype listing U.S. states?
Hi Laura,
At least you admit you're being lazy. ;-) I was curious to see if the U.S. States existed as a list in the .NET framework (similar to how countries are listed in the System.Globalization namespace) ... but alas it's not there!
So using the super cool 'AbstractDataEditor', I've coded one up for you!
Copy-n-paste this code into a .cs file and drop it into your App_Code folder - the Umbraco back-office should pick it up.
I've posted this up on my GitHub too - for future reference: https://gist.github.com/1217575
(Credit for the States list is from StackOverflow)
Enjoy!
Cheers, Lee.
Hi, just a thought, but would an Enum of US states also be useful within any .net code ? if so (it's also less code) could just define an Enum and use the Enum DropDownList datatype.
HTH,
Hendy
An alternative (again in uComponents) is JSON DropDown ... that is, if you can find a reliable JSON data-source?
Wow, you guys are awesome. So many options, so little time..
This doesnt work for me. Am I missing something?
This doesn't work also for me. Any solution ?
Hi, if it's for v7, here's one approach to make a drop-down list of US States:
http://www.proworks.com/blog/archive/simple-and-cool-use-for-the-nupickers-umbraco-package-for-v7/
Yeah, It's for v7 Let me try this as solution, but how can I implement this with class I dont want to use models, controllers.. I just want to find a way to use with some .cs file in which will be placed all states, and after that I need to render the state in a view (partial or just razor view). Any help ?
Okey, I try this but only I get is a full dropdown in backoffice, and I want to show that on front. (in view or in partial view)
I try everything but no success. First I create Data Type and config the nuPicker as is shown on link. After that I could see all values in dropdown (backoffice). I add a composition with this data type and I want to show it on view as I told before.
I try
but no success. I want to dispaly dropdown with its value and after that need to use that dropdown for filtering data.
is working on a reply...