Hello,
When you select a file to be uploaded, it is not being sent to the controller to be saved to a directory or SQL Server. When the controller Async_MedicalCertificateSave is called the parameter files always has 0 count.
Thanks in advance for your help.
My code is as follows:
HTML
@(Html.Kendo().Upload() .Name("Popupfiles") .Multiple(false) .Async(a => a .Save("Async_MedicalCertificateSave", "SAC") .Remove("Async_MedicalCertificateRemove", "SAC") .AutoUpload(true) ) .Events(events => events .Upload("OnUpload") .Select("onSelect") ))
JAVSCRIPT
function OnUpload(e) { var cboStudent = $("#StudentId").data("kendoMultiColumnComboBox"); e.data = { StudentId: cboStudent.value() };}function onSelect(e) { document.getElementById("OriginalFilename").value = getFileInfo(e);}
CONTROLLER
public async Task<ActionResult> Async_MedicalCertificateSave(IEnumerable<IFormFile> files, int StudentId){ ccwFormsModel db = new ccwFormsModel(); // The Name of the Upload component is "files" if (files != null) { foreach (var file in files) { var filetype = file.ContentType; var fileContent = ContentDispositionHeaderValue.Parse(file.ContentDisposition); //var filetype = fileContent.DispositionType; string dt = DateTime.Now.ToString("yyyyMMdd_HHmm"); string extension = Path.GetExtension(fileContent.FileName.ToString().Trim('"')); var fileName = StudentId.ToString() + "_MedicalCert_" + dt + extension; var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName); using (var fileStream = new FileStream(physicalPath, FileMode.Create)) { var objfiles = new TmpFileUpload() { TmpFileId = 0, StudentId = StudentId, Filename = fileName, OriginalFilename = file.FileName, FileType = filetype }; using (var target = new MemoryStream()) { file.CopyTo(target); objfiles.UploadedFile = target.ToArray(); } db.TmpFileUploads.Add(objfiles); db.SaveChanges(); } } } // Return an empty string to signify success return Content("");}public ActionResult Async_MedicalCertificateRemove(string[] fileNames){ // The parameter of the Remove action must be called "fileNames" ccwFormsModel db = new ccwFormsModel(); if (fileNames != null) { foreach (var fullName in fileNames) { var fileName = Path.GetFileName(fullName); var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName); TmpFileUpload lst = db.TmpFileUploads.FirstOrDefault(a => a.OriginalFilename.Equals(fileName)); db.TmpFileUploads.Remove(lst); db.SaveChanges(); } } // Return an empty string to signify success return Content("");}So I have used a grid with batch edit (in cell) for editing offer positions. The offers are quiet big and usually have between 20 and 500 positions.The performance is now really bad and this is almost not usable...
The reason are quiet simple the DOM is getting to big. The simple solution would of course be to implement paging. But the customer needs to see all positions and can even move the positions with drag & drop. It feels kinda too late to change it to paging. It would be a step backwards.
With some tests I have found out that mostly the EditorTemplates are mostly the issue. I use here quiet complex controlls.
Do you have any ideas how to easily improve the performance? Is it maybe possible to render the EditorTemplate during runtime if a cell is clicked?
Here the code for the grid, it is dynamic with some definition classes:
@(Html.Kendo().Grid<dynamic> () .Name(gridName) .Events(events => events .DataBound("insertRowCount")) .Columns(columns => { foreach (var col in definition.Grid.Fields.Where(f => !f.Internal)) { var clientTemplate = ""; var kCol = columns.Bound(!string.IsNullOrEmpty(col.Alias) ? $"{col.Alias}_{col.Name}" : col.Name) .Title(col.Title); if (col.FieldType is IntegerField) { kCol.EditorTemplateName("GridIntegerField").EditorViewData(new { fieldType = col.FieldType }); } else if (col.FieldType is DoubleField) { kCol.EditorTemplateName("GridDoubleField").EditorViewData(new { fieldType = col.FieldType }); } else if (col.FieldType is ListValueField) { kCol.EditorTemplateName("GridListValueField").EditorViewData(new { fieldType = col.FieldType }); clientTemplate = $"#= htmlDecode({col.Name}_Display) #"; } else if (col.FieldType is DataEntityLinkField) { //columns.Bound(typeof(string), $"{col.Name}_Display").Hidden(true); kCol.EditorTemplateName("GridDataEntityLinkField").EditorViewData(new { fieldType = col.FieldType }); clientTemplate = $"#= htmlDecode({col.Name}_Display) #"; } else if (col.FieldType is CurrencyField) { kCol.EditorTemplateName("GridCurrencyField").EditorViewData(new { fieldType = col.FieldType }); clientTemplate = $"#=grid.currencyFormat({col.Name}) #"; } else if (col.FieldType is BoolField) { kCol.EditorTemplateName("GridBoolField").EditorViewData(new { fieldType = col.FieldType }); } else if (col.FieldType is TextField) { kCol.EditorTemplateName("GridTextField").EditorViewData(new { fieldType = col.FieldType }); } else if (col.FieldType is DateField) { clientTemplate = $"#=grid.dateFormat({col.Name}) #"; kCol.Editable("function () { return false; }"); } if (!string.IsNullOrEmpty(col.ClientTemplate)) { clientTemplate = col.ClientTemplate; } else if (col.FieldType is EditorField) { clientTemplate = $"#= htmlDecode({col.Name}) #"; } if (!string.IsNullOrEmpty(clientTemplate)) kCol.ClientTemplate(clientTemplate); if (!string.IsNullOrEmpty(col.ClientGroupHeaderColumnTemplate)) kCol.ClientGroupHeaderColumnTemplate(col.ClientGroupHeaderColumnTemplate); if (col.Width > 0) { kCol.Width(col.Width); } if (!string.IsNullOrEmpty(col.Format)) { kCol.Format(col.Format); } if (autoIncrementFields.Contains(col.Name)) kCol.Editable("function () { return false; }"); } if (!definition.Grid.HideBatchEditButtons) columns.Command(command => { command.Custom("Löschen").Text(" ").IconClass("k-icon k-i-delete").Click("batchEditDelete") .HtmlAttributes(new { @class = "nu-grid-button", @title = "Löschen" }); if (definition.Grid.ShowNewButton) command.Custom("Neu").Text(" ").IconClass("k-icon k-i-add").Click("batchEditNewAfter") .HtmlAttributes(new { @class = "nu-grid-button", @title = "Neue Zeile einfügen" }); }); }) .ToolBar(toolbar => { if (definition.Grid.ShowNewButton) toolbar.Custom() .HtmlAttributes(new { onclick = "batchEditNew();" }) .Name("new") .Text("Neu") .IconClass("k-icon k-i-plus"); if (!definition.Grid.HideBatchEditButtons) toolbar.Save().SaveText("Änderungen speichern").CancelText("Änderungen verwerfen"); }) .Sortable(false) .Filterable() .Selectable() .Editable(editable => editable.Mode(GridEditMode.InCell)) .DataSource(datasource => datasource.Ajax() .Model(model => { model.Id("Id"); if (sortField is IntegerField) { model.Field(sortField.Name, typeof(int)); } model.Field(Model.ParentLink, typeof(Guid)).DefaultValue(Model.ParentId).Editable(false); model.Field("Id", typeof(Guid)).DefaultValue(Guid.Empty).Editable(false); model.Field("Entity", typeof(string)).DefaultValue(Model.Entity).Editable(false); foreach (var col in definition.Grid.Fields.Where(f => f.FieldType is DataEntityLinkField || f.FieldType is ListValueField)) { model.Field($"{col.Name}", typeof(Guid)).DefaultValue(Guid.Empty); model.Field($"{col.Name}_Display", typeof(string)).DefaultValue(string.Empty); } foreach (var col in definition.Grid.Fields.Where(f => f.FieldType is CurrencyField)) { model.Field(col.Name, typeof(double)).DefaultValue(0.0); } }) .Batch(true) .Read(read => read.Action("BatchEditRead", "Entities", new { parentId = Model.ParentId, entity = Model.Entity, useLink = Model.ParentLink, orderBy = sortField.Name })) .Create("BatchEditUpdateOrCreate", "Entities") .Update("BatchEditUpdateOrCreate", "Entities") .Destroy("BatchEditDelete", "Entities") .Events(events => events.Error("error").Change(definition.Grid.ChangeEvent)) .ServerOperation(false) ) .AutoBind(true) )
Hello, I am using kendo grid in .NET core,
We have load dynamically data in grid using Data table I have bind data and also functional server side pagination. I have facing the issue in grouping on dynamically. Can you please help how can I resolved this issue. or share any document?
I have also attached my code screenshots. Please review and let me know asap.
Hi All,
I am working kendo grid and using incell editing mode also adding a simple drop down box, my problem is that drop down box is not rending in the grid, it appears for a while and this disappear.
Can anybody help me? Any event i am missing?? timeout issue ??
thanks
Hi,
I have a razor page where I have two separate forms. Each form will submit and call a separate OnPostAsync method.
To make this happen normally you would use the following:
<input type="submit" value="Submit" asp-page-handler="FormOne"/>
Which would call the method OnPostFormOneAsync().
How do I achieve the same using a TagHelper button, e.g.
<kendo-button name="TestButton" icon="filter" type="submit" asp-page-handler="FormTwo">Test</kendo-button>
Thanks
Russell
Hello,
I currently have a working .netcore 2.2 web project that has telerik 2019.1.115 installed. This project has .netframework 4.7.2 references.
In the process of migrating .netcore from 2.2 to 3.1, we have encountered retro-compatibility issues. From the moment we upgraded our .netcore version, we started getting errors on loading libraries in the startup class on endpoint configuration :
"Unable to load one or more of the requested types.\r\nCould not load file or assembly 'System.Data.Linq, Version=4.0.0.0'. The system cannot find the file specified.\r\nCould not load file or assembly 'System.Data.Linq, Version=4.0.0.0'.
After alot of investigation, we pinpointed that the combination of .netcore 3.1 and telerik together was causing this problem. After migration to 3.1, if we remove the telerik libraries and references, the endpoints get configured properly and we are able to access the website. When adding back the telerik package, the endpoints immediately fail to configure.
Any help would be appreciated
David
I'm trying to create a Telerik ASP .NET Core MVC Application (Grid Razor Pages) that uses .NET 5. However, there's not an option for .NET 5. Is this not possible?
Thanks,
Tim
Is there a user who has succesfully used UI for ASP.Net Core in ABP.io commercial?
ABP.io loads all scripts at the bottom of the page but kendo requires it's scripts to be loaded near/at the top of the page.
We do not have access to the supplied theme pages, so we are unable to move the scripts ourselves.
I am already engaging with ABP.io support to resolve this, but i am curious if someone else already has been able to work around these limits.

Hi,
I've been trying to use the sass theme builder to replace the kendo theme delivered by the CDN here https://kendo.cdn.telerik.com/2020.2.513/styles/kendo.bootstrap-v4.min.css
When I go on the SASS builder, select to start based on bootstrap 4, I change the colours and download the compiled .css but there are some fundamental differences in the bootstrap source between the standard theme and the generated theme.
My understanding is that the theme produced by the themebuilder should be the same with the only difference being the colour, however I've already noticed the following differences
CDN version
.k-textbox { padding: .375rem .75rem; ...
SASS generated version
.k-textbox { padding: 0; ...
another one (slightly different css selected but different display type for form component.
CDN version
.k-dropdown .k-dropdown-wrap .k-input, .k-dropdowntree .k-dropdown-wrap .k-input { display: flex;...
SASS version
.k-dropdown, .k-dropdowntree { display: inline-flex;
So in summary if I use the SASS generated version, I will have to override a number of the generated css that is not relating to color theme in order to 'fix' it back to bootstrap standards. This is undesirable. I just want to be able to switch in the SASS generated version to replace the color set which is how I understand it should work.
thanks