I'm wrote this action
[Authorize] public IActionResult Item_ReadData([DataSourceRequest] DataSourceRequest request, string dateFiler) { CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); var selectedDate = DateTime.Parse(dateFiler, culture); System.Security.Claims.ClaimsPrincipal currentUser = this.User; var scope = currentUser.Claims.ToList().SingleOrDefault(c => c.Type == "Scope")?.Value; using (DbNavision ctx = new DbNavision()) { var itemsFound = (from rec in ctx.UpSrlItem select new ItemModel(rec, selectedDate, scope)); var dataResult = itemsFound.ToDataSourceResult(request); return Json(dataResult); } }
It works ok! But if I apply a filter on a column (attach what I'm doing), it shows me this error.
System.InvalidOperationException: 'The LINQ expression 'DbSet<UpSrlItem> .Where(u => new ItemModel( u, __selectedDate_0, __scope_1 ).No.ToLower() == "fratverde")' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync().
Model output is a custom, because I need to update additional properties of model that aggregate several information.
I can't use ToList() or other, because result contains a lot of rows. Infact I added .Scrollable(scrollable => scrollable.Virtual(true)) property on Grid.
This is my model costructor
01.public ItemModel(UpSrlItem item, Nullable<DateTime> dateFilter, string locationFilter)02. {03. No = item.No;04. Description = item.Description;05. Brand = item.Brand;06. 07. using (DbNavision ctx = new DbNavision())08. {09. //Net Change10. List<UpSrlItemLedgerEntry> netChange;11. 12. if (locationFilter != "")13. netChange = (from rec in ctx.UpSrlItemLedgerEntry14. where rec.ItemNo == No &&15. rec.LocationCode == locationFilter &&16. rec.PostingDate <= dateFilter17. select rec).ToList();18. else19. netChange = (from rec in ctx.UpSrlItemLedgerEntry20. where rec.ItemNo == No &&21. rec.PostingDate <= dateFilter22. select rec).ToList();23. 24. NetChange = netChange.Sum(ile => ile.Quantity);25. 26. //Purchases (Qty.) + Positive Adjmt. (Qty.) 27. List<UpSrlItemLedgerEntry> purchasesQty;28. 29. if (locationFilter != "")30. purchasesQty = (from rec in ctx.UpSrlItemLedgerEntry31. where rec.ItemNo == No &&32. rec.LocationCode == locationFilter &&33. rec.PostingDate <= dateFilter &&34. (rec.EntryType == (int)UpSrlItemLedgerEntryEntryTypes.Purchase ||35. rec.EntryType == (int)UpSrlItemLedgerEntryEntryTypes.Positive_Adjmt)36. select rec).ToList();37. else38. purchasesQty = (from rec in ctx.UpSrlItemLedgerEntry39. where rec.ItemNo == No &&40. rec.PostingDate <= dateFilter &&41. (rec.EntryType == (int)UpSrlItemLedgerEntryEntryTypes.Purchase ||42. rec.EntryType == (int)UpSrlItemLedgerEntryEntryTypes.Positive_Adjmt)43. select rec).ToList();44. 45. PurchasesQty = purchasesQty.Sum(ile => ile.Quantity);46. 47. UpSrlItemLedgerEntry lastEntry;48. if (locationFilter != "")49. lastEntry = (from rec in ctx.UpSrlItemLedgerEntry50. where rec.ItemNo == No &&51. rec.LocationCode == locationFilter &&52. rec.PostingDate <= dateFilter53. select rec).ToList().LastOrDefault();54. else55. lastEntry = (from rec in ctx.UpSrlItemLedgerEntry56. where rec.ItemNo == No &&57. rec.PostingDate <= dateFilter58. select rec).ToList().LastOrDefault();59. 60. LastEntryDate = lastEntry?.PostingDate;61. 62. }63. }
My Grid Column Filter for a Time value is not working by this definition:
Model
public partial class Session : PropertyBase{ [Display(Name = "Id")] public int Id { get; set; } [Display(Name = "Device Id")] public System.Int32? DeviceId { get; set; } [Display(Name = "Group Id")] public System.Int32? GroupId { get; set; } [MaxLength(50)] public System.String UniqueId { get; set; } = $"{Guid.NewGuid()}"; /// <summary> /// Track when the session took place /// </summary> public System.DateTime? Timestamp { get; set; } [NotMapped] [DataType(DataType.Date)] public System.DateTime? Date => Timestamp; [NotMapped] [DataType(DataType.Time)] public System.DateTime? Time => Timestamp;
Grid
@(Html.Kendo().Grid<Session>() .Name("grid") .Columns(columns => { columns.Command(command => command .Custom("Detail") .Click("goDetail")) .Width(Glossary.Portal.ButtonWidth); columns.Bound(p => p.Date).Title("Date").Format("{0:MM/dd/yyyy}") .Filterable(ftb => ftb.Cell(cell => cell.Operator("gte") .ShowOperators(false))); columns.Bound(p => p.Time).Title("Time") .Format("{0:hh:dd:mm tt}") .Filterable(x => x.UI(GridFilterUIRole.TimePicker)); }) .Pageable() .Sortable() .Scrollable() .Filterable(ftb => ftb.Mode(GridFilterMode.Row)) .HtmlAttributes(new { style = "height:550px;" }) .Selectable() .Navigatable() .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Read(read => read.Action("IndexJson", "Sessions") .Data("gridGetData"))))Hello support,
I want to use the Asp.Net Core extensions but I can't install the package Telerik.UI.for.AspNet.Core.Trial because it isn't found.
I followed the instructions at this link https://www.telerik.com/download-trial-file/v2/aspnet-core-ui but when I go to the option "Manage Nuget packages for solution" these are the packages available to download (see the attached file).
What can I do to install the package Telerik.UI.for.AspNet.Core.Trial?
Thank you.

I would pass DatePicker value to datasource of grid, using Data method in this way
<div class="d-inline"> <label>Data</label> @(Html.Kendo().DatePicker() .Name("dateFilterDatepicker") // The name of the DatePicker is mandatory. It specifies the "id" attribute of the widget. .Min(new DateTime(1900, 1, 1)) // Sets the min date of the DatePicker. .Max(new DateTime(2099, 12, 31)) // Sets the max date of the DatePicker. .Value(DateTime.Today) // Sets the value of the DatePicker. ) @(Html.Kendo().Button() .Name("textSearchButton") .HtmlAttributes( new {type = "submit"} ) .Content("Ricerca") .Events(e=>e.Click("onClick"))) </div> <div class="text-center form-group"> @(Html.Kendo().Grid<ItemModel>() .Name("itemGrid") .ToolBar(t => t.Search()) .Filterable() .AutoBind(true) .Columns(columns => { columns.Bound(f => f.No); columns.Bound(f => f.Description); columns.Bound(f => f.Brand); columns.Bound(f => f.NetChange); columns.Bound(f => f.PurchasesQty); columns.Bound(f => f.LastEntryDate).Format("{0:dd/MM/yyyy}"); ; }) .Pageable() // Enable paging .Sortable() // Enable sorting .Scrollable(scrollable => scrollable.Virtual(true)) .HtmlAttributes(new { style = "height:430px;" }) .DataSource(dataSource => dataSource //Configure the Grid data source. .Ajax() //Specify that Ajax binding is used. .PageSize(20) .Read(read => read.Action("Item_ReadData", "Home").Data("additionalData")) // Set the action method which will return the data in JSON format. ) ) </div> <script> function additionalData() { var value = $("#dateFilterDatepicker").data("kendoDatePicker").value(); return { selectedDate: value }; // send the filter value as part of the Read request } function onClick() { var grid = $("#itemGrid").data("kendoGrid"); grid.dataSource.read(); // rebind the Grid's DataSource } </script>But I'm sure that date is valued, but it seems that not fires additionalData function when it request read method of datasource
My action
[Authorize] public IActionResult Item_ReadData([DataSourceRequest] DataSourceRequest request, DateTime selectedDate) { var itemsFound = new List<ItemModel>(); System.Security.Claims.ClaimsPrincipal currentUser = this.User; var scope = currentUser.Claims.ToList().SingleOrDefault(c => c.Type == "Scope")?.Value; using (DbNavision ctx = new DbNavision()) { if (selectedDate != new DateTime(1, 1, 1)) itemsFound = (from rec in ctx.UpSrlItem select new ItemModel(rec, selectedDate, scope)).ToList(); var dataResult = itemsFound.ToDataSourceResult(request); return Json(dataResult); } }
The second parameter of action is ever empty, but if I remove it from action definition, is the same.
what's wrong?

I have the scheduler set to timelinemonth view. I would like to create events in the scheduler by simply clicking on the day for a particular attendee. I cant find a way to create the event programmatically without showing the dialog. Unfortunately the "add event" method simply shows the dialog.
I can call the create method in the controller from jquery but then I would have to refresh the page to show the new data.

I have a multi-step UI that requires the user select a group from a TreeList. That group selection must then be used to feed into a Grid that is populated by People that are in that selected Group.
How do I do this? I've been using the PanelBar up to this point to perform multi-step processes. However, I've never had to base the data selection in step 2 with the selection from step 1. Can I late bind the Grid so it will go get its data when the host Tab is selected?

Hi,
We recently updated our .NET Core web app from Kendo UI v2019.3.1023 to Kendo UI v2020.1.219. The kendo.bootstrap-v4.min.css file contains a change that produces some fairly drastic jitter and row height changes in editable grids with custom ClientTemplates:
.k-grid .k-command-cell, .k-grid .k-edit-cell, .k-grid .k-grid-edit-row td { padding: calc(.75rem - (1.5em + .75rem + 2px - 1.5em)/ 2) .75rem}
I have confirmed the issue is in the above css by removing it and observing that editable grid rows don't jitter and change height when you click on an editable cell. Is this a bug or was this an intended change in behaviour? What is the best / easiest way to completely remove this behaviour? There is nothing special about the grid other than the checkbox ClientTemplate:
@(Html.Kendo().Grid(Model.Create) .Name("CreateGrid") .Navigatable() .Editable(editable => editable.Mode(GridEditMode.InCell)) .Events(events => events.Edit("OnCreateGridEdit")) .Columns(columns => ...Kind regards,
David

Hello,
When I call the following javascript API:
1.var grid = $('#Results').data('kendoGrid');2.var ds = grid.dataSource;3.var parameters = ds.transport.parameterMap({ sort: ds._sort, page: ds._page }, "read");then I get an output like this:
{"sort":"Name-asc~Email-desc","page":2,"group":"","filter":""}
Is there any way (.net core or javascript) to pass the string "Name-asc~Email-desc" to the grid (or the datasource or any related objects) in order to apply the sorting ?
Thanks a lot!