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

Grid Filtering / Missing Records

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Headygains
Top achievements
Rank 1
Veteran
Headygains asked on 17 Sep 2020, 02:58 PM

Hello,

I'm currently experiencing issues with a grid control not showing all the records that should be available for a search term.

The method supplying the dataset:

1.return this.Context.Orders.OrderByDescending(record => record.OrderId).Select(
2.                record => new OrderDtoModel
3.                {
4.                    Id = record.OrderId.ToString(),
5.                    EdiNumber = record.EDICustomerReference ?? string.Empty,
6.                    Due = record.DueDate,
7.                    Status = record.OrderStatu.StatusName
8.                }).ToDataSourceResultAsync(request);

DTO Model:

01.public class OrderDtoModel
02.{
03.    public string Id { get; set; }
04.
05.    public string EdiNumber { get; set; }
06.
07.    public DateTime? Due { get; set; }
08.
09.    public string DueDate
10.    {
11.        get
12.        {
13.            return this.Due.HasValue ? this.Due.Value.ToString(CultureInfo.InvariantCulture) : string.Empty;
14.        }
15.    }
16.
17.    public string Status { get; set; }
18.}

And finally the grid definition:

 

01.@(Html.Kendo().Grid<OrderDtoModel>().Name("order_grid").Columns(col =>
02.{
03.    col.Bound(o => o.Id).Width(150);
04.    col.Bound(o => o.EdiNumber).Width(150);
05.    col.Bound(o => o.Status).Width(150);
06.    col.Command(o => o.Custom("Manage").Click("manage_order"));
07.}).ToolBar(toolbar =>
08.{
09.    toolbar.Search();
10.}).Sortable()
11.    .Pageable()
12.    .Scrollable()
13.    .Groupable()
14.    .ClientDetailTemplateId("detail-template")
15.    .HtmlAttributes(new{ style="height:750px"})
16.    .DataSource(source => source.Ajax()
17.        .PageSize(45)
18.        .Read(read => read.Action("GetOrderDtos", "Order")))
19.    .Events(events => events.DataBound("on_bind"))
20.    )

 

Is there a better way to filter the results provided to the grid? Like how am I supposed to limit records returned in a meaningful way? How can I determine why the records I'm not seeing aren't showing up? Running a simple SQL query gets my results and the records do not have anything different than normal records from surface inspection.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Sep 2020, 09:05 AM

Hello,

 

At first glance, the provided code looks fine and there should be no issues.

Could you modify the attached web site to demonstrate the problem and send it back to us for further investigation? Then, we will provide more accurate and precise suggestions.

 

Regards,
Eyup
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
Headygains
Top achievements
Rank 1
Veteran
Answers by
Eyup
Telerik team
Share this question
or