Ends in:
7 DAYS
12 HRS
5 MIN
59 SEC
Ends in:
7 D
12 H
5 M
59 S
Open Closed

Problem with DataGridColumn DisplayTemplate when generating a master-child relationship #6524


User avatar
0
ageiter created
  • ABP Framework version: v8.0.1
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)

Steps to reproduce the issue:

1. Create a master entity in the Abp Suite
2. Generate the master (without "Add migration" - I only want to do this once I have generated all the entities correctly)
3. Create a child entity with the above master as parent
4. Generate the child -> ends with error due to DB migration
5. Compile the solution -> ends with error in DataGrid, see below

1. Problem:

If the child entity contains properties that require a DisplayTemplate in the DataGrid (e.g. bool or DateTime), this leads to the following error when compiling:

RZ9999 The child content element 'DisplayTemplate' of component 'DataGridColumn' uses the same parameter name ('context') as enclosing child content element 'DetailRowTemplate' of component 'DataGrid'. Specify the parameter name like:'<DisplayTemplate Context="another_name">to resolve the ambiguity

I can solve this by writing something like <DisplayTemplate Context="option_context"> (you already do this with the actions, for example), but it is then overwritten every time I have to regenerate the entity.

2. Problem:

With the child, there is no option to deactivate the DB migration. If you don't want this for the master, then you don't want it for the child either. In addition, because of the above error, it naturally means that a migration can never be created because of the error in the DataGrid.

Thanks for fixing and refunding it.

Adrian


3 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    With the child, there is no option to deactivate the DB migration. If you don't want this for the master, then you don't want it for the child either. In addition, because of the above error, it naturally means that a migration can never be created because of the error in the DataGrid.

    Hi, yes you are right, the child entity should respect the master entity's option for migration creation. I have created an internal issue (#16434), and fix it asap.

    I have refunded your ticket, thanks for reporting these problems. Closing the question.

    Best regards.

  • User Avatar
    0
    ageiter created

    Thank you, but the main problem is the error in the DataGrid and not the migration ;-) But I assume you created a bug for that too.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thank you, but the main problem is the error in the DataGrid and not the migration ;-) But I assume you created a bug for that too.

    Yes, in the issue that I created, I mentioned these two problems :)

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06