Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Allen 50 posts 71 karma points
    Oct 24, 2011 @ 14:16
    Tom Allen
    0

    Using Data Type in usercontrol

    Quick question - is there any way to use an uComponents data type (country picker, specifically) within a usercontrol, in which it would render as a dropdown and be programatically available to the codebehind?

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Oct 24, 2011 @ 14:20
    Lee Kelleher
    0

    Hi Tom,

    The Country Picker data-type populates the dropdown list with countries from the .NET framework.  It would be simplier to create your own DropDownList, than trying to re-use the data-type control.

    Simon Dingly has a good blog post on this: C# Utility method to populate list controls with all countries as given in ISO 3166-1

    Cheers, Lee.

  • Bogdan 250 posts 427 karma points
    Oct 24, 2011 @ 14:22
    Bogdan
    0

    Sure, from the user control you can read the property of that data type just like any other property, with maybe the difference that the result would be xml.

  • Tom Allen 50 posts 71 karma points
    Oct 24, 2011 @ 14:52
    Tom Allen
    0

    Brilliant - cheers!

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Oct 24, 2011 @ 15:01
    Jeroen Breuer
    0

    It's also possible to add real Data Types to a UserControl. Have a look at this topic: http://our.umbraco.org/forum/developers/extending-umbraco/6863-Datatype-on-normal-page-or-UserControl.

    Jeroen

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies