Copied to clipboard

Flag this post as spam?

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


  • Jacob 39 posts 88 karma points
    Feb 08, 2013 @ 20:14
    Jacob
    0

    Datatype from UserControl, DataEditorSetting, System.InvalidCastException

    Hello

    I am trying to add a new Datatype from a UserControl.

    Just to get the basic working I started out with an example from the web

            [DataEditorSetting("Statuses", type=typeof(umbraco.editorControls.SettingControls.Values), description="Enter list of possible statuses")]

            public string GetStatuses { get; set; } 

    But when I make a Datatype from a usercontrol with the code above, which is equal to the example im following, I get "An object of the type ASP.usercontrols_testMyUserControl_ascx cannot be converted to the type umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor."

    Hope someone can tell me what I am doing wrong here. 

    Thanks

  • Wouter 49 posts 76 karma points
    Jul 01, 2013 @ 13:48
    Wouter
    1

    Inherit from IUsercontrolDataEditor:

    public partial class MyUserControl : System.Web.UI.UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jul 01, 2013 @ 13:49
    Tim Geyssens
    0

    Indeed, you can find an example here http://www.nibble.be/?p=97

  • 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