Rank: Newbie
Joined: 12/3/2007 Posts: 9
|
Hi there,
I'm looking to use a custom datatype in a usercontrol.
Specifically, I want to populate a drop down in my usercontrol with the contents of a custom drop down datatype I created in my umbraco installation. (In my case, it contains a list of Regions I want the user to be able to filter a search by)
I've not found enough useful documentation and especially not enough examples of using the API to do something like this.
Has anyone done this, or something similar, and can share their knowledge with the rest of us?
I'm assuming (hoping really) that there is some object in the API to represent a datatype; given that, I would hope to be able to instantiate one by giving it the name (or at least the id) of the custom datatype, which would make it go and get the prevalues from the database; and then use that object to create a DataSource for my DropDownList.
Anyone got anything on that?
Cheers, Chris
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,074 Location: Charleston, West Virginia, United States
|
Hi Chris. I think this is possible, but you would have to reference the control and the prevalue values directly and also call the control instance programmatic. You can see the editor controls in the source code, and will see how the control is called from the datatypes class. You should be able to extract the logic to do what you are after. What are you wanting to do with your control?
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|