I'm having some problems with custom items that has properties of type IList. The items work fine on create, view, update, delete... but I get an exception when I try to copy a page containing an item with IList properties.
The two properties on the item...
[Field("Categories", typeof(CheckboxListEditor<>))] public IList<string> Categories { get; set; } [Field("Tags", typeof(TagListEditor))] public IList<string> Tags { get; set; }
TagListEditor is a custom Editor...
[Editor("Tag list")] public class TagListEditor : ListEditor<IEnumerable<string>> { ... }
If you could provide some sample code for a custom item with IList properties that actually works it would be very much appreciated ;-)
[InvalidCastException: Invalid cast from 'System.String' to 'System.Collections.Generic.IList`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.] System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +10578274 System.String.System.IConvertible.ToType(Type type, IFormatProvider provider) +8 System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +10625268 System.Convert.ChangeType(Object value, Type conversionType) +32 Dynamicweb.Extensibility.AddInManager.SetAddInPropertyValue(Object instance, String PropertyName, Object PropertyValue, Boolean tryConvert) +175 Dynamicweb.Content.Items.ItemEntry.DeserializeFrom(IDictionary`2 dictionary) +108 Dynamicweb.Content.Items.ItemEntry.GetCodeFirstInstance(String systemName) +147 Dynamicweb.Content.Items.ItemEntry.Save() +88 Dynamicweb.Content.StructureChange.CopyPage(Int32& fromPageID, String& toLanguage, Int32& motherPage, Boolean& copyParagraphs, Boolean& copySubPages, Int32 copyID, Int32 sortVal, String newPageID, String copyTime) +1987 Dynamicweb.Admin.Page_Copy.Page_Load(Object sender, EventArgs e) +720 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772