Fix empty ExtraProperties cells in AbpExtensibleDataGrid#25480
Merged
Conversation
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<TItem> 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.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes AbpExtensibleDataGrid rendering for ExtraProperties[...] columns by explicitly naming the DisplayTemplate context so Razor codegen references the correct CellDisplayContext<TItem>.Item (preventing the cast from being applied to the context object itself).
Changes:
- Add
Context="rowContext"to theDisplayTemplateused forExtraProperties[...]columns. - Update template references from
context.ItemtorowContext.Itemto ensure correct generated code.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rel-10.3 #25480 +/- ##
============================================
+ Coverage 49.37% 49.79% +0.42%
============================================
Files 3670 3609 -61
Lines 123598 120822 -2776
Branches 9453 9232 -221
============================================
- Hits 61032 60169 -863
+ Misses 60743 58847 -1896
+ Partials 1823 1806 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
enisn
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The implicit
<DisplayTemplate>context caused the Razor source generator to compilecontext.Item as IHasExtraPropertiesintocontext as IHasExtraProperties(dropping.Item). SinceCellDisplayContext<TItem>itself does not implementIHasExtraProperties, the cast was always null and the cell rendered as<!--!-->.Renaming the context with
Context="rowContext"produces the expectedrowContext.Item as IHasExtraPropertiescodegen and the cell now displays the extension property value.Affects every page using
AbpExtensibleDataGridwith JSON-onlyExtraProperties[xxx]columns (Saas Tenants, Identity Users, etc.).Reported in https://abp.io/support/questions/10690.