Custom Formatter option with all FormatString parameters #1343

Closed
opened 2026-01-29 17:52:20 +00:00 by claunia · 0 comments
Owner

Originally created by @jesshannon on GitHub (Aug 13, 2024).

Is your feature request related to a problem? Please describe.
As an example, when binding a RadzenDataGridColumn to a boolean, by default it shows True/False. I'd like an easy repeatable way to control that without having to add custom templates

Describe the solution you'd like
Along with the FormatString property, I'd like to be able to give either an instance of or a type of an IFormatter. This could then be a custom formatter or even a Culture formatter that controls date/number formats.

Example usage:

<RadzenDataGridColumn Property="Complete" Title="Complete" FormatProviderType="MyYesNoFormatter" />
<RadzenDataGridColumn Property="Total" Title="Total" FormatString="{0:c}" FormatProvider="@(new CultureInfo(record.Culture))" />
Complete Total
No $1,099.95
Yes 1.010,95 €
Yes £15.99

Describe alternatives you've considered
The only alternative is creating custom templates

Originally created by @jesshannon on GitHub (Aug 13, 2024). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can request your feature via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. --> **Is your feature request related to a problem? Please describe.** As an example, when binding a RadzenDataGridColumn to a boolean, by default it shows True/False. I'd like an easy repeatable way to control that without having to add custom templates **Describe the solution you'd like** Along with the FormatString property, I'd like to be able to give either an instance of or a type of an IFormatter. This could then be a custom formatter or even a Culture formatter that controls date/number formats. Example usage: ``` <RadzenDataGridColumn Property="Complete" Title="Complete" FormatProviderType="MyYesNoFormatter" /> <RadzenDataGridColumn Property="Total" Title="Total" FormatString="{0:c}" FormatProvider="@(new CultureInfo(record.Culture))" /> ``` | Complete | Total | | ------------- | ------------- | | No | $1,099.95 | | Yes | 1.010,95 € | | Yes | £15.99 | **Describe alternatives you've considered** The only alternative is creating custom templates
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1343