We have a custom command in a UI for ASP.NET Core FileManager control that states the icon as a simple textual name which worked fine in 2023.1.117
items.Add("").Type("button").Name("refresh").Icon("reload").Text("Refresh").Click("onRefresh").HtmlAttributes(new { style = "margin-left: 5px;" });
Hi All,
I have a problem. I've a not working grid. I do a compilated query for get the data but the data never gets loaded in the grid.
What is the error? Thanks in advance for any help.
Content of controller
using DataLayerIAccess.Repository;
using DataLayerIAccess.Repository.Queries;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;
using WebViewerIAccess.Models;
namespace WebViewerIAccess.Controllers
{
public class GridController : Controller
{
private readonly IAccessDbContext _context;
public GridController(IAccessDbContext context)
=> _context = context;
public async Task<IActionResult> ElencoPresenze_Read([DataSourceRequest] DataSourceRequest request)
{
var elencoPresenze = (await _context.GetElencoPresenze(0, 10)).ToList();
var presenzeViewModel = Utilities.MapFromAType<PresenzeModel>(elencoPresenze);
var dsResult = presenzeViewModel.ToDataSourceResult(request);
return Json(dsResult);
}
Content of .cshtml
@{
ViewData["Title"] = "Presenze";
}
<div class="text-center">
@(Html.Kendo().Grid<WebViewerIAccess.Models.PresenzeModel>()
.Name("grid")
.Columns(c => {
c.Bound(p => p.ID);
c.Bound(p => p.Nome);
c.Bound(p => p.Cognome);
c.Bound(p => p.Giorno);
c.Bound(p => p.Reparto);
}) .Pageable(p => p
.PageSizes(new[] { 10, 20, 50 })
.Refresh(true)
.Responsive(true))
.Sortable()
.Filterable()
.Scrollable()
.Groupable()
.DataSource(ds => ds
.Ajax()
.Batch(true)
.PageSize(20)
.AutoSync(true)
.ServerOperation(false)
.Events(e => e.Error("error_handler"))
.Model(m => {
m.Field(p => p.ID);
m.Field(p => p.Nome);
m.Field(p => p.Cognome);
})
.AutoSync(true)
.Read(r => r.Action("ElencoPresenze_Read", "Grid"))
</div>
<script type="text/javascript">
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
</script>
Content of Model
using System;
namespace WebViewerIAccess.Models
{
public class PresenzeModel
{
public int ID { get; set; }
public string Nome { get; set; }
public string Cognome { get; set; }
public DateTime Giorno { get; set; }
public string Reparto { get; set; }
}
}
thank you
I am relatively new to ASP.Net core (.net6) and I am trying to bind the Kendo scheduler with my existing data source.
Background: I am tasked with replacing outdated javascript tools for our "shipping scheduler", which is very similar to the Telerik Scheduler Timeline view.
Here is an example of what I am trying to achieve...
The data source is a simple API source from the web (for example https://mydomain.com/datasource), with the following structure:
namespace ShippingSchedulerApp.Models
{
public class SchedulerEvent
{
public long ID { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { get; set; }
public string? text { get; set; }
public string? shipclass { get; set; }
public decimal? beam { get; set; }
public string? sectionID { get; set; }
public string? flag { get; set; }
public string? country { get; set; }
public string? visitnumber { get; set; }
public int? visitid { get; set; }
public int? imo { get; set; }
public string? details { get; set; }
public string? cargo { get; set; }
public decimal? duration { get; set; }
public decimal? loa { get; set; }
public string? stevedore { get; set; }
}
}
If someone could point me to a demo or a sample way of connecting the above to the Telerik Scheduler Timeline view, that would be great.
Thanks
I find myself having a heck of a time getting started with the scheduler. Is there a SIMPLE getting started example that explains how to use the scheduler? All I am looking to do is to have a monthly view and be able to display availability of items. An item could be, for example, a room at a hotel. I won't be doing anything more granular than day level scheduling. I want to block out a date on the calendar for an item. That's it. Once I can figure out how to do that, I can dig deeper myself.
Any guidance would be greatly appreciated.
Hello,
I have a DropDownList that I would like to cache based on a radio button
Code DropDownList :@( Html.Kendo().DropDownList() .Name("orders") .DataTextField("Companies_name") .DataValueField("CompaniesId") .MinLength(3) .HtmlAttributes(new { style = "width:25%" }) .Template("#= CompaniesId # | #= Companies_name #") .Height(520) .Filter(FilterType.Contains) .DataSource(source => { source .Ajax() .PageSize(80) .Read("Virtualization_Read", "NewUploadAccount"); }) .Events(e => { e.Change("onChange"); }) .Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper")) )
I'm using ASP NET CORE. I have a grid and I enable filtering on a column with .Filterable(). Is there a way to sort the items that appear in the checkbox filter?
EX:
My filter would look like this
And not
When the drop down is displayed.
Hi There,
I'm working on a web app and need to access the Excel column with letters instead of an index. I have gone through the documentation but didn't find how we can access the Excel column with alphabets such as A20
Could you please let me know if you have any functions or not?
Thanks,
I have a nested grid in a client template. Everything on my pages works great. I would like to refresh the parent grid when the nested gid is updated. The only way I have found to do this is to use the RequestEnd event on the nested grid, so I defined it in the gird's data source:
I have a function defined to handle the event:
<script type="text/javascript">
function onCampaignRequestEnd(e) {
console.log('Campaign grid on request end");
var programGrid = $("#programGrid").data("kendoGrid");
programGrid.dataSource.read();
}
</script>
No matter where I put this script on the page, I receive this error when expanding the parent grid. I even tried adding it the parent grid and received the same error. I have similar scripts defined in outer pages and have never see this happen:
3383:1 Uncaught ReferenceError: onCampaignRequestEnd is not defined
Hi,
I upgraded Telerik version in our project (Telerik.UI.for.AspNet.Core nuget) from version 2021.2.616 to version 2023.1.425 and since then is for TabStrip component not working LoadContentFrom.
I have in my controller method like this:
public IActionResult GetProductListPartial()
{
return PartialView("_ProductList");
}
And in my View I have code like this:
@(Html.Kendo().TabStrip() .Name("tabstrip") .Items(tabstrip => { tabstrip.Add() .Text(@Localizer["Menu.ProductList"]) .Selected(true) .LoadContentFrom("GetProductListPartial", "ProductList") .ContentHtmlAttributes(new { @class = "product-list-tab" }); }))
When I reworked implementation in the View, then it started to work again:
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(tabstrip =>
{
tabstrip.Add().Text(@Localizer["Menu.ProductList"])
.Selected(true)
//.LoadContentFrom("GetProductListPartial", "ProductList")
.Content(@<text>@await Html.PartialAsync("_ProductList")</text>)
.ContentHtmlAttributes(new { @class = "product-list-tab" });
}))