Kendo grid filtering - numeric filter with percentage format

1 Answer 593 Views
Grid NumericTextBox
SR
Top achievements
Rank 1
SR asked on 06 Dec 2021, 11:08 PM | edited on 08 Dec 2021, 08:28 PM
I have a kendo grid with one column in the percentage format. Currently I am using the built in numeric filter with format = {0:p4} but when I enter 2 for example, the value is automatically multiplied by 100 and converted to 200.0000%. I don't want it to automatically multiply my input value by 100. How can I prevent that?

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 09 Dec 2021, 05:07 PM

Hi,

To prevent the multiplication of the value entered in the Numeric Filter Cell, use the format property in the NumericFilterCellComponent to define the custom format with the "%" specifier. For example:

<kendo-grid-column filter="numeric" format="{0:p4}">
  <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
    <kendo-grid-numeric-filter-cell
      format="#.0000 \\\%"
    >
    </kendo-grid-numeric-filter-cell>
  </ng-template>
</kendo-grid-column>

In this StackBlitz example, the value in the Numeric Filter Cell does not multiply by 100.

I hope this helps. Please let me know if I can further assist you.

Regards,
Hetali
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

SR
Top achievements
Rank 1
commented on 09 Dec 2021, 06:08 PM

Thank you. Could you let me know what component I should use for menu type numeric filter, instead of <kendo-grid-numeric-filter-cell>?
Hetali
Telerik team
commented on 09 Dec 2021, 07:09 PM

Please use the NumericFilterMenuComponent for the Filter Menu in the Kendo UI Grid. This article has the list of available built-in Filter templates.
Tags
Grid NumericTextBox
Asked by
SR
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or