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

Filtering is broken for some values... again

5 Answers 423 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
iCognition
Top achievements
Rank 1
iCognition asked on 18 Mar 2016, 02:54 AM

I've reported this before on the forum and through support tickets.

If you have a grid column with the name "Fields[3].Value" Kendo throws an exception unnecessarily when trying to filter on it.

This can be fixed by adding a period to the list of accepted characters in the FilterLexer. I've done this myself a few times and I'm a bit tired of having to rebuild it every time Kendo gets updated...

 

Expected token
at Kendo.Mvc.Infrastructure.Implementation.FilterLexer.Tokenize()
   at Kendo.Mvc.Infrastructure.Implementation.FilterParser..ctor(String input)
   at Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
   at System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor)
   at System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState)

5 Answers, 1 is accepted

Sort by
0
iCognition
Top achievements
Rank 1
answered on 21 Mar 2016, 02:48 AM
namespace Kendo.Mvc.Infrastructure.Implementation
{
    using System;
    using System.Collections.Generic;
    using System.Text;
 
    public class FilterLexer...
     
        private static bool IsIdentifierPart(char character)
        {
            return char.IsLetter(character) || char.IsDigit(character) || character == '_' || character == '$' || character == '[' || character == ']';
        }
0
Rosen
Telerik team
answered on 23 Mar 2016, 07:21 AM

Hello Matt,

Such expression (which uses indexer) is not supported for filtering as it may not be translated by the QueryableProviders. If this is working on your side I suspect that the processing is done in-memory (using LinqToObjects).

Regards,
Rosen
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
MARCO
Top achievements
Rank 1
answered on 16 Oct 2020, 01:54 PM

Good Day,

how didi you access the FilterLexer class ?

thanks

Marco

0
MARCO
Top achievements
Rank 1
answered on 16 Oct 2020, 02:48 PM

Rosen Can you help out ?

I don't understand if we have a fix for this issue, I have the same problem, thanks

Marco

0
Nikolay
Telerik team
answered on 20 Oct 2020, 12:12 PM

Hello Marco,

The names of the fields used for columns must be valid JavaScript identifiers. A valid identifier must not contain. For a more detailed description of what characters are accepted in an identifier check out the blog post below:

Furthermore, there is a JavaScript variable name validator you can use to check if a name is a valid identifier.

Once a valid name is provided for the columns the Grid including the operations as filtering, sorting etc. shall work just fine.

Please let m know if you have any questions.

Regards,
Nikolay
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/.

Tags
General Discussions
Asked by
iCognition
Top achievements
Rank 1
Answers by
iCognition
Top achievements
Rank 1
Rosen
Telerik team
MARCO
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or