Propertylist of Propertylist of page not showing properly


I have a page with Ilist property and the property has Ilist property in it. While displaying in CMS, it shows [object Object],[object Object] in grid. My code looks like below.

        [EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<MyPropType>))]
        [Display(Name = "Something = 11)]
        public virtual IList<MyPropType> MyProps{ get; set; }

       public class MyPropTypeListProperty : PropertyListBase<MyPropType>


	public class MyPropType
		[EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<MySecondPropType>))]
      		  public virtual IList<MySecondPropType> MySecondProps{get;set;}

	public class MySecondPropType

   	 public class MySecondPropTypeProperty : PropertyListBase<MySecondPropType>

Edited, Aug 02, 2019 13:04


I think, if you want to change the way the grid is rendered, you're going to have to write a bit of dojo. I don't know how you want the nested list to display but, assuming you have a property on MySecondPropType called ItemName and you want the nested list to appear in the grid as a list of the ItemName properties, one per line, you could create a JavaScript file like this:

    function (
    ) {
        return declare([CollectionEditor], {
            _getGridDefinition: function () {
                var result = this.inherited(arguments);
                // Apply custom formatting to the mySecondProps property here
                // Note the fact that property names are converted to camel case
                result.mySecondProps.formatter = function (values) {
                    return => x.itemName).join('<br/>');
                return result;

If you save that to a location (e.g. /scripts/dojo/MyCustomCollectionEditor.js), you can then reference it from your list property like this:

[ClientEditor(ClientEditingClass = "/scripts/dojo/MyCustomCollectionEditor.js")]
public virtual IList<MyPropType> MyProps { get; set; }

Which should use the customised version of the collection editor to render the grid with the nested list neatly formatted.

Aug 02, 2019 19:29
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.