Using custom datatype in user control Options
chrisevans
Posted: Wednesday, December 05, 2007 11:05:15 PM
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





neehouse
Posted: Friday, December 14, 2007 6:31:28 AM

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 •
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.