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

Grid SuggestionsOperator not showing correct results when initially filtering the datasource...

5 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 07 Jun 2019, 01:54 PM

I have created a grid to show a list of employees. The grid columns are filterable and I have set an initial IsLeaver filter on the data source to only show non-leavers. The problem I have is the suggestion operator is not initially showing all the results I would expect.

For example "LocationA" does not show up as a suggestion when initially trying to type this into the location filter. However, when I press enter their are lots of rows with "LocationA" that show up in the grid.  I am using "contains" for both the operator and suggestion operator so they should be the same.

If I clear the IsLeaver filter in the browser and then set it back to the same value then "LocationA" will start appearing in the suggestions operator.

If I do not set an initial IsLeaver filter and just set the filter in the browser then "LocationA" correctly appears in the suggestions operator.

@(Html.Kendo().Grid(Model)
 .Name("EmployeeDataGrid")
 .Columns(columns =>
 {
    columns.Bound(p => p.ID).Filterable(f => f.Cell(c => c.ShowOperators(false).Operator("contains").SuggestionOperator(FilterType.Contains)));
    columns.Bound(p => p.Name).Filterable(f => f.Cell(c => c.ShowOperators(false).Operator("contains").SuggestionOperator(FilterType.Contains)));
    columns.Bound(p => p.Location).Filterable(f => f.Cell(c => c.ShowOperators(false).Operatord("contains").SuggestionOperator(FilterType.Contains)));
    columns.Bound(p => p.IsLeaver);
})
.Pageable()
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.DataSource(dataSource => dataSource
    .Ajax()
    .ServerOperation(false)
    .Filter(f => f.Add(p => p.IsLeaver).IsEqualTo(false))))

 

Any suggestions as to why "LocationA" is not initially showing up in suggestion operator when there are definitely rows for "LocationA" that are not leavers. I can see these rows when I apply the filter so I can't understand why "LocationA" does not appear in the suggestion operator. 

5 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 07 Jun 2019, 01:58 PM
Forgot to say that I am using Kendo MVC 2018.3.1017.545.
0
Viktor Tachev
Telerik team
answered on 11 Jun 2019, 08:10 AM
Hello Paul,

I examined the code and noticed that there was a typo in the configuration of the Location column. Please remove the extra "d" from the Operators option and see how that affects the behavior.

columns.Bound(p => p.Location).Filterable(f => f.Cell(c => c.ShowOperators(false).Operatord("contains").SuggestionOperator(FilterType.Contains)));

With that said, I tested the behavior with our online example and the suggestions were displayed as expected on my end. Please check out the short video below and let me know if I am missing something:


Also, would you update the components to the latest release and see if the issue is still observed. If it is please send us a runnable sample where the behavior is replicated so we can examine it. 

Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Paul
Top achievements
Rank 1
answered on 11 Jun 2019, 10:06 AM

The d was just a typo when I was trying to post the forum topic... I couldn't see how to update the original post to remove it.

I looked through the release notes and couldn't see anything that would indicate this has been fixed in a later version.  I can try and upgrade, but it will take me some time to do this and was hoping to avoid this if possible.

I'll see about getting this done if you don't have any other suggestions and the code above (with exception of the 'd') looks ok to you.

 

 

0
Viktor Tachev
Telerik team
answered on 13 Jun 2019, 08:05 AM
Hi Paul,

Another thing I can suggest trying is binding the Grid using Ajax binding. Instead of passing the Model directly to the Grid specify only the type and configure the Read Action for the DataSource to request the data. Like in the Binding to remote data example.

In case the behavior persists please send us a runnable project where it is replicated so we can examine it locally.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrew
Top achievements
Rank 1
answered on 26 Apr 2021, 05:24 PM

@Telerik - I'm having a very similar issue to OP where the grid filter row is not showing all of the matching results.  The filter by default is using the same datasource as the grid itself.  When we increase the page size on the grid, the filter row then returns all of the expected results.  This appears to be a bug since I would expect the suggested autocomplete results to come from the entire data set regardless of grid page size.  Is this a known issue?   

Thanks,
Andrew

Viktor Tachev
Telerik team
commented on 28 Apr 2021, 09:01 AM

Hi Andrew,

 

The behavior you are describing can be observed if server and client operations are mixed - for example using client-side filtering and server paging. In that scenario the filtering will be applied only to the items that are available on the client.

Would you send the Grid configuration you are using so we can examine it? Additionally you can send us a runnable sample where the behavior is replicated. This will enable us to examine it and look for what is causing the behavior.

 

Regards,

Viktor Tachev

Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Viktor Tachev
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or