0
我有下面的代碼,Telerik的網格 - 日期列 - 過濾過去的日期不工作
@(Html.Telerik().Grid(Model.Results)
.Name("ResultsGrid")
.NoRecordsTemplate("No records found.")
.Columns(columns =>
{
columns.Bound(s => s.Id).Title("User Id").Template(
model => @Html.ActionLink(model.Id.ToString(), "Action1", "Controller1", new { UserId = model.Id}, new Dictionary<string, object>() { { "class", "xyz" } })
).Width(100);
columns.Bound(s => s.Address).Title("Address").HeaderHtmlAttributes(new { title = "Address" });
columns.Bound(s => s.City).Title("City").HeaderHtmlAttributes(new { title = "City" }).Width(140);
columns.Bound(s => s.State).Title("State").HeaderHtmlAttributes(new { title = "State" }).Width(60);
columns.Bound(s => s.Zip).Title("Zip").HeaderHtmlAttributes(new { title = "Zip" }).Width(100);
columns.Bound(s => s.FromDate).Title("From Date").HeaderHtmlAttributes(new { title = "From Date" }).Format("{0:M/d/yyyy}").Width(160);
columns.Bound(s => s.ToDate).Title("To Date").HeaderHtmlAttributes(new { title = "To Date" }).Format("{0:M/d/yyyy}").Width(180);
})
.ClientEvents(e => e.OnLoad("alignHeight"))
.DataBinding(dataBinding =>
{
dataBinding.Server().Select("SameAction", "SameController");
})
.Scrollable(sc => sc.Enabled(true))
.Sortable(so => so.Enabled(true))
.Pageable(paging => paging.PageSize(10).Style(GridPagerStyles.NextPreviousAndDropDown).Position(GridPagerPosition.Both))
.Filterable(f => f.Enabled(true))
.Groupable(g => g.Enabled(false))
.Resizable(r => r.Columns(true))
)
與過濾日期列工作正常,當前和未來的日子,但是當我嘗試使用過去的日期進行篩選。網格顯示「找不到記錄」。我有記錄過去的日期,我期待網格顯示匹配過濾器。我正嘗試通過應用「is equal to」運算符進行過濾。
是否有任何額外的代碼,我必須實施處理日期列的過去日期?
下面是傳遞到控制器的請求, (HTTP://本地主機/ SameController/SameAction ResultsGrid頁= 1 &ResultsGrid-ORDERBY =〜 &ResultsGrid濾波器= FROM日期〜當量〜datetime'2010-04 -22T00-00-00' - 過去日期 &ResultsGrid-size = 10) – user3608840