Programatically create a dynamic property

Member since: 2007
 

Is it possible to programatically create a dynamic property?

If a specific dynamic property is missing I would like to create it for the editor...

#26554 Dec 10, 2008 20:35
  • Member since: 1996
     

    That is possible.

    If you dont add PageTypeID the property will be a dynamic property

    otherProp = new PageDefinition();

    otherProp.FieldOrder = prop.FieldOrder;

    otherProp.Type = new PageDefinitionType(prop.Type.ID, prop.Type.DataType, prop.Type.Name);

    otherProp.PageTypeID = page.ID;

    otherProp.Tab = prop.Tab;

    otherProp.Name = prop.Name;

    otherProp.HelpText = prop.HelpText;

    otherProp.EditCaption = prop.EditCaption;

    otherProp.Searchable = prop.Searchable;

    otherProp.Required = prop.Required;

    otherProp.LanguageSpecific = prop.LanguageSpecific;

    otherProp.LongStringSettings = prop.LongStringSettings;

    otherProp.Save();

    otherProp.ClearCache();

    #26558 Dec 11, 2008 10:18
  • Member since: 2007
     

    Cool! Thanks a lot!

    Cool

    #26617 Dec 12, 2008 22:33
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
Please login to post a reply