Skip to content

NestedDataModelCollection and [CustomEntity] int property with PreviewTitle only showing ID #557

Description

@mcockrellsana

Hello,

As the title suggests, I'm trying to figure out a solution to show the name of the custom entity in the NestedDataModelCollection when it shows on the Admin UI for editing in the list. Right now, if I set the [PreviewTitle] attribute on the [CustomEntity] property like so:

On a ICustomEntityDataModel

[Display(Name = "Rankings")]
    [NestedDataModelCollection(IsOrderable = true)]
    public ICollection<SchoolRankingDataModel> Rankings { get; set; }
}
public class SchoolRankingDataModel : INestedDataModel
 {
     [Display(Description = "Ranking Category")]
     [CustomEntity(RankingCategoryEntityDefinition.DefinitionCode)]
     [Required]
     [PreviewTitle]
     public int RankingCategory { get; set; }

     [Display(Description = "Score")]
     [Required]
     [PreviewDescription]
     public decimal Score { get; set; }

     [Display(Description = "Rank")]
     [Required]
     public int Rank { get; set; }
 }

This only shows the CustomEntity ID on the Admin UI editing screen when viewing the list. Is there a way to configure this, or route in a custom way for the listing to show the custom entities [PreviewTitle] property itself? I have [PreviewTitle] set on a string property in the custom entity that is being selected, but this seems to be ignored, and either only uses the int property or if I take it off of the int property, shows nothing.

Thanks in advance for the advice!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions