For example, I'd like something like this:
Field Name: record.TotalSales -> Auto-generated column title: "Total Sales" with inserted space
ADMIN EDIT: See also the idea below about "AutoGeneratedTitles" Func<string, string> property where the user could perform whatever processing they liked upon the default value. Please leave your comment on what approach you would prefer to be exposed.
Thank you for the idea, Michael, we will consider it. Providing an out-of-the-box solution for the most common case will be significantly easier to use, though, so I am not sure if a function call will be what happens. Let's see what the community thinks, though, maybe people will prefer it. I've edited the opener post to mention this.
Regards,
Marin Bratanov
Progress Telerik
Thank you for the idea, Jesse. This would work for columns you define explicitly in a grid, but the idea in the feature request is that the grid does this for the columns it generates automatically from the model - you can't set their Title like that because you don't have them in the markup.
Regards,
Marin Bratanov
Progress Telerik
Michael,
I know you may want it built in to the Telerik UI, but why not use Humanizer: https://github.com/Humanizr/Humanizer
You would then be able to do something like
<AuthorizeView>
<TelerikGrid Data=@GridData
@ref="@Grid"
Pageable="true"
Groupable="true"
Sortable="true"
FilterMode="GridFilterMode.FilterMenu"
Resizable="true"
Reorderable="false"
PageSize="20">
<GridColumns>
<GridColumn Field="@nameof(record.TotalSales).Humanize(LetterCase.Title)" />
<GridColumn Field="@nameof(record.ReallyLongVariableName).Humanize(LetterCase.Sentence)" />
</GridColumns>
</TelerikGrid>
</AuthorizeView>
For the community benefit - for the time being the best option is to use the [Display(Name="The Desired Title")] data annotation attribute on the model: https://docs.telerik.com/blazor-ui/components/grid/columns/auto-generated#customization
If this does not become the default behavior, I imagine it would be exposed as a setting on the GridAutoGeneratedColumns tag.
Regards,
Marin Bratanov
Progress Telerik