Copied to clipboard

Flag this post as spam?

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


  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 30, 2012 @ 14:32
    Rune Grønkjær
    0

    How to load Umbraco data type in custom dashboard control (Dark magic?)

    Hi,

    I'm trying to figure out how to load any given Umbraco data type in one of my own dashboard controls.

    E.g. if I have a drop down list data type or content picker or whatever that I need to use in my dashboard control with all the settings and stuff.

    How do I do that??

    Umbraco does it everywhere but must be doing it using some kind of dark magic, because there's apparently no code in the source code that have that specfic responsibility.

    /Rune

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 30, 2012 @ 18:26
  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 31, 2012 @ 07:59
    Rune Grønkjær
    0

    Hi Jeroen,

    Looks promising. Can see I'm not the only one having had this problem. Not the easiest thing to figure out.

    I will try it and see if that solves all my future problems :)

    /Rune

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 31, 2012 @ 14:38
    Rune Grønkjær
    0

    AND IT WORKS. HAHAHAHAHAAH, IT'S ALIIIIIVE.

    Thanks a bunch Jeroen. Three simple lines of code.

    DataTypeDefinition dataTypeDefinition1 = DataTypeDefinition.GetDataTypeDefinition( 1753 );
          dropdown dropDown = (dropdown)dataTypeDefinition1.DataType.DataEditor;
          PaymentMethod.Controls.Add( dropDown );

    The above code loads a simple Dropdownlist data type. I expect to be able to do the same with a bunch of other data types.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft