This is a migrated thread and some comments may be shown as answers.

Preventing Filter Row from Autoformatting on Blur

3 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
The Bearded One
Top achievements
Rank 1
The Bearded One asked on 30 Nov 2015, 06:01 PM

Steps to reproduce...

1. Any old datagrid with a filter row enabled

2. Go to any numeric columns and enter a value in the filter field

3. Blur the field (tab out or click anywhere) the value

4. The value entered in the filter column is reformatted.

 ---

I was trying to filter my grid with a record number of 571339. It is just an int in my view model -- not formatted as Currency. When I tab out of the grid, it reformats it to 571,339.00. It's not breaking anything, but it's annoying one of my vocal customers.

 

How can I initialize my grid in MVC to not reformat numeric values to currency?

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 02 Dec 2015, 09:01 AM
Hello,

In order to achieve this you can define a template for the filter cell. Check out the following dojo example that illustrates the approach:



Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
The Bearded One
Top achievements
Rank 1
answered on 02 Dec 2015, 02:09 PM

Thanks!

 

Your response got me down the trail I needed. I am initializing my grid in MVC so I ended up with this...

columns.Bound(u => u.BemsId).Filterable(filter => filter.Cell(u => u.Template("IntegerFilter")));

 

and then

 

        function IntegerFilter(args) {
            args.element.kendoNumericTextBox({ format: "n0", decimals: 0, spinners: false });
        }

 

0
Viktor Tachev
Telerik team
answered on 04 Dec 2015, 08:10 AM
Hello,

Thank you for sharing your implementation with the community. This can be helpful to someone trying to implement similar feature.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
The Bearded One
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
The Bearded One
Top achievements
Rank 1
Share this question
or