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.