You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow access to GetDisplayName for components #65108
In addition, third-party components also have the same problem in libraries like DevExpress, SyncFusion, Telerik etc. that all need to show the display name for UI. The issue MudDataGrid: Support DisplayAttribute for PropertyColumn title demonstrates the need for commonality.
The proposal would mean opening up access to GetDisplayName in the ExpressionMemberAccessor class. It's such a common use case that should be unified within Blazor, instead of separate implementations. Also consider moving namespace to Microsoft.AspNetCore.Components as this functionality isn't restricted to forms.
The proposal would mean opening up access to GetDisplayName in the ExpressionMemberAccessor class.
This is what the component is for. Instead of using a PropertyColumn you could use a TemplateColumn and automatically provide the DisplayName component. Other components can use the DisplayName component to render the display name at the right time.
In general, components are our public interface and extensibility point. We don't expose internal helpers like the one you mention as that precludes from changing things in the future if we need to.
This is what the component is for. Instead of using a PropertyColumn you could use a TemplateColumn and automatically provide the DisplayName component. Other components can use the DisplayName component to render the display name at the right time.
OK, but that's a lot of extra markup you would need for every column. The existing solution in documentation to subclass PropertyColumn and then use <DisplayNameColumn Property="movie => movie.ReleaseDate" /> is better IMO.
MudBlazor has an elegant solution using an attribute on the model to automatically assign the form labels shown in Automatically set Labels. This has to be a such a common use case that should be adopted elsewhere by components like QuickGrid.
Will link this issue in the ASP.NET Core Roadmap for .NET 11 discussion to get feedback from other users regarding this feature.
At my job, we're using Blazor across most of our applications, and we have this same need in our codebase. For now, my workaround was to just copy the implementation of ExpressionMemberAccessor from the aspnetcore source code (the parts that could be copied; I skipped the Hot Reload content).
We have a pretty nontrivial shared component surface area, and we often need to know things about the related form model properties above and beyond just the display name, for which we also use MemberInfo static caching. To express further interest from the user-base, I and my team of 13 think it would be nice to have access to ExpressionMemberAccessor as a feature, as well as some more support for getting other data annotation metadata, leveraging MemberInfo static caching. We're pretty committed to Blazor and would enjoy the QoL / DX.
Activity
javiercn commentedon Jan 19, 2026
@mguinness thanks for contacting us.
This is what the component is for. Instead of using a
PropertyColumnyou could use aTemplateColumnand automatically provide theDisplayNamecomponent. Other components can use the DisplayName component to render the display name at the right time.In general, components are our public interface and extensibility point. We don't expose internal helpers like the one you mention as that precludes from changing things in the future if we need to.
mguinness commentedon Jan 20, 2026
OK, but that's a lot of extra markup you would need for every column. The existing solution in documentation to subclass PropertyColumn and then use
<DisplayNameColumn Property="movie => movie.ReleaseDate" />is better IMO.MudBlazor has an elegant solution using an attribute on the model to automatically assign the form labels shown in Automatically set Labels. This has to be a such a common use case that should be adopted elsewhere by components like QuickGrid.
Will link this issue in the ASP.NET Core Roadmap for .NET 11 discussion to get feedback from other users regarding this feature.
kgar commentedon Nov 13, 2026
At my job, we're using Blazor across most of our applications, and we have this same need in our codebase. For now, my workaround was to just copy the implementation of ExpressionMemberAccessor from the aspnetcore source code (the parts that could be copied; I skipped the Hot Reload content).
We have a pretty nontrivial shared component surface area, and we often need to know things about the related form model properties above and beyond just the display name, for which we also use MemberInfo static caching. To express further interest from the user-base, I and my team of 13 think it would be nice to have access to ExpressionMemberAccessor as a feature, as well as some more support for getting other data annotation metadata, leveraging MemberInfo static caching. We're pretty committed to Blazor and would enjoy the QoL / DX.