From ad6de43563ac4ecd7928c1d53b99747ba8a0f248 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 26 May 2026 21:37:44 +0800 Subject: [PATCH] Fix empty ExtraProperties cells in AbpExtensibleDataGrid The implicit DisplayTemplate context caused the Razor source generator to compile 'context.Item as IHasExtraProperties' into 'context as IHasExtraProperties' (dropping the .Item access). Since CellDisplayContext itself does not implement IHasExtraProperties, the cast was always null and the cell rendered empty. Renaming the context with Context="rowContext" produces the correct 'rowContext.Item as IHasExtraProperties' codegen and the cell now shows the property value. --- .../Components/AbpExtensibleDataGrid.razor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index da90bd66e7..c1891ebda2 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -120,9 +120,9 @@ else { - + @{ - var entity = context.Item as IHasExtraProperties; + var entity = rowContext.Item as IHasExtraProperties; var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value; var propertyValue = entity?.GetProperty(propertyName); if (propertyValue != null && propertyValue.GetType() == typeof(bool)) @@ -140,7 +140,7 @@ { if (column.ValueConverter != null) { - @((MarkupString)GetConvertedFieldValue(context.Item, column)) + @((MarkupString)GetConvertedFieldValue(rowContext.Item, column)) } else {