Declined
Last Updated: 24 Aug 2023 07:13 by ADMIN
Stephen
Created on: 17 Aug 2023 15:31
Category: Kendo UI for Angular
Type: Feature Request
1
Custom Grid Messages for Individual Columns

Currently it is possible to override certain messages of the kendo grid with the KendoGridMessages component.

However, this applies the message to the entire grid at once.
For example assume I have a grid with 2 boolean value columns, I would like to override the filter menu IsTrue & IsFalse messages to another string.
This is entirely possible with the KendoGridMessages component.
After the columns in my grid I might put something like this:

<kendo-grid-messages filterIsTrue="Yes" filterIsFalse="No"></kendo-grid-messages>

 

This would work if I wanted both boolean filter menus to display Yes & No.
But lets suppose I have set a template for cells in one of the columns like so:

<ng-template kendoGridCellTemplate let-dataItem>
{{ dataItem.Validated ? "Validated" : "Not Validated" }}
</ng-template>

the cells in this column would now display 'Validated' or 'Not Validated' instead of true/false.
It would make more sense for this column filter menu to have 'Validated' & 'Not Validated' instead of the Yes/No message that has been set to the entire grid.

Currently I would have to choose between one or the other strings for the boolean filter, either Yes/No or Validated/Not Validated.

This is a simple example, and in this case using the Yes/No messages for both wouldn't cause a user too much head-ache, but there are plenty of other more complex use cases where not having individual grid messages could cause confusion.

 

Here is a Stackblitz where I have mocked the grid:
https://stackblitz.com/edit/angular-qynsrr?file=src%2Fapp%2Fapp.component.ts

In the above Stackblitz I've mocked what I would expect it to work like.
I would expect that you can add a KendoGridMessages in the grid to set a default, and then on each column override it as necessary with another component or another KendoGridMessages.

1 comment
ADMIN
Martin Bechev
Posted on: 24 Aug 2023 07:13

Hi Stephen,

Thank you for the provided feedback, runnable examples, and practical use cases.

You are right. When changing the custom messages of the Grid through the CustomMessagesComponent properties, the changes are applied in each place where the message is being used (like in this case for every boolean Filter Menu). But this is the expected behavior considering the fact that no customizations are made to the Grid. By default Is True and Is False radio buttons are rendered no matter how many boolean columns are defined:

In this case, the CustomMessagesComponent is expected to overwrite each boolean filter menu. 

If the boolean filter menu (as well as filter row) should contain different options, styling, or other customizations in order to fit specific project requirements, using the kendoGridFilterMenuTemplate (as in the StackBlitz example) kendoGridFilterCellTemplate is the right way to go. 

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources