Hello friends. My second day with Kendo UI for ASP.NET MVC (newbie questions):
tl;dr version:
This:
@Html.HiddenFor(model => model.ProjectID)... lines ommitted for brievity.ClientFooterTemplate("<div style='text-align:right;color:blue;'><a href='" + Url.Action("Index", "PurchaseInvoice/#= ProjectID #")+"'>#= kendo.format('{0:C}',sum)#</a></div>");generates this:
<a href="/PurchaseInvoice/[object HTMLInputElement]">$191,449.65</a>which shows the amount as a link (great). But what I need to be generated is this:
<a href="/PurchaseInvoice/259">$191,449.65</a>... where 259 is the ProjectID.
Note that ProjectID is part of the model, but not of the grid's data. That's likely my problem here.
What am I missing? Is there an easier way to do this?
Long version:
@(Html.Kendo().Grid<DataLibrary.ProjectCost>() .Name("CostGrid") .Columns(columns => { columns.Bound(c => c.Month) .Width(100) .Title("Mois") .Hidden(); columns.Bound(c => c.SupplierName) .Width(300) .Title("<div style='text-align:left;'>Fournisseur </div>") .HtmlAttributes(new { @style = "text-align:left;" }) .ClientFooterTemplate("<div style='text-align:right;'>TOTAL: </div>"); columns.Bound(c => c.OrderAmount) .Format("{0:C}") .Width(100) .Title("Commandé") .HtmlAttributes(new { @style = "text-align:right;" }) .ClientGroupHeaderColumnTemplate("#= kendo.format('{0:C}',sum)#") .ClientFooterTemplate("<div style='text-align:right;'>#= kendo.format('{0:C}',sum)#</div>"); columns.Bound(c => c.InvoiceAmount) .Format("{0:C}") .Width(100) .Title("Facturé") .HtmlAttributes(new { @style = "text-align:right;" }) .ClientGroupHeaderColumnTemplate("#= kendo.format('{0:C}',sum)#") .ClientFooterTemplate("<div style='text-align:right;color:blue;'><a href='" + Url.Action("Index", "PurchaseInvoice/#= projectID #")+"'>#= kendo.format('{0:C}',sum)#</a></div>"); }) .DataSource(dataSource => dataSource .Ajax() .Aggregates(aggregates => { aggregates.Add(c => c.OrderAmount).Sum(); aggregates.Add(c => c.InvoiceAmount).Sum(); }) .Group(groups => { groups.AddDescending(c => c.Month); }) .Read(read => read.Action("CostSummary", "Project", new { ID = Model.projectID })) ) .Events(events => events.DataBound("collapseGroupRows")))
I've tried many variations:
.ClientFooterTemplate("<div style='text-align:right;color:blue;'>#= kendo.format('{0:C}',sum)#</div>");.ClientFooterTemplate("<div style='text-align:right;color:blue;'><a href='/PurchaseInvoice?ProjectID=#=projectID#'>#= kendo.format('{0:C}',sum)#</a></div>");.ClientFooterTemplate("<div style='text-align:right;color:blue;'><a href='/PurchaseInvoice?ProjectID=#=projectID#>#= kendo.format('{0:C}',sum)#</a></div>");.ClientFooterTemplate("<div style='text-align:right;color:blue;'><a href='/PurchaseInvoice?ProjectID=#=projectID#>#= kendo.format('{0:C}',sum)#</a></div>");.ClientFooterTemplate(@Html.ActionLink("#= kendo.format('{0:C}',sum)#","Index", "PurchaseInvoice", new { ProjectID = "#= projectID#" }, null).ToHtmlString());.ClientFooterTemplate(@Html.ActionLink("#= kendo.format('{0:C}',sum)#","Index", "PurchaseInvoice", new { ProjectID = "#=projectID#" }, new { @style = "text-align:right;color:blue;" }).ToHtmlString());.ClientFooterTemplate(@Html.ActionLink("#= kendo.format('{0:C}',sum)#","Index", "PurchaseInvoice", new { ProjectID = "#= projectID#" }, null ).ToHtmlString());.ClientFooterTemplate(@Html.ActionLink("#= kendo.format('{0:C}',sum)#","Index", "PurchaseInvoice", new { ProjectID = "#= projectID#" }, null ).ToHtmlString());
Perhaps one of these is a (almost) better implementation (none of these work as-is though).
Thanks
hi
I try to show my image instead of the icon of image in viewer.
i use
.Views(v=>v.List(a=>a.TemplateId("template")))
<script id="template" type="text/kendo-ui-template">
<img src="~/Content/UserFiles/Folders/Images/demos-web.png"/>
</script>
bot it dose not show any things.
i upload two image show with template and without template.
thank you.
Hi all,
I need to do a Multi Filter on a column that can has more that one value. For example the value in the column contains the values Blue and Green. When a user selects blue in the multi select as a option I would like for any row that has blue in that that column to be returned. For further explanation see this dojo I created to explain what I am trying to do.
I am also looking to create a custom filterable ui widget that uses the kendoMultiSelect and a custom filter on the data source that will make use of my custom filterable ui widget. I am not sure if this will work. Any help on this would be great.
How can I submit the wizard's model to the Controller.i.e. on Done(), how can submit the binded model to the controller?
please hep. I am new and stuck on this.
Hi Team,
Currently i am working on KenoMvc Grid , which have group by on two columns and we are showing aggregates in group footers.
On inline row delete row got deleted but aggregates not updating . Please explain me what could be the reason.
Please help me to understand the grid refresh on edit.
Thanks & Regards,
Purnima.
I am trying to render a grid hierarchy. Here is my code.
Parent Grid
@Code Html.Kendo().Grid(Of BenchStatusIndicatorMVC.Target)() _ .Name("Grid") _ .ToolBar(Function(t) t.Search() End Function) _ .Columns(Sub(c) c.Bound(Function(p) p.StandardId) c.Bound(Function(p) p.PC) c.Bound(Function(p) p.DateEntered) c.Bound(Function(p) p.DateModified) c.Bound(Function(p) p.Type) End Sub) _ .Pageable(Sub(x) x.PageSizes(True) End Sub) _ .ClientDetailTemplateId("template") _ .Sortable() _ .Filterable() _ .DataSource(Function(d) d.Ajax() _ .Read(Function(read) read.Action("Target_Read", "Target")) _ .ServerOperation(False) _ .Model(Sub(m) m.Id(Function(i) i.StandardId) End Sub) End Function) _ .Render()End Code I'm trying to set up an upload for some quite large files, which involves using chunked asynchronous uploads.
Once the file has been transferred, a record is saved to a database, with details of the file name, and an ID passed back to the web page.
I was able to get this working when the upload wasn't using chunks, but I'm now a bit stuck.
The example in your documentation (https://docs.telerik.com/aspnet-mvc/html-helpers/editors/upload/chunk-upload ) seems to be written for .later versions of the >NET framework (or .NET core), as I cannot find namespaces to include IFormFile or JsonSerializer . I'm using .NET Framework 4.7.2
I have got a version working (the file is saved to the upload folder), however, when the upload is complete, it does not call the Save procedure., which saves a record to a database, renames the file, and passes back a fileID.
The code is:-
public ActionResult ChunkSave(IEnumerable<HttpPostedFileBase> files, string metaData) { if (metaData == null) { return Save(files); } MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(metaData)); var serializer = new DataContractJsonSerializer(typeof(ChunkMetaData)); ChunkMetaData chunkData = serializer.ReadObject(ms) as ChunkMetaData; string path = String.Empty; string uploadFolder = SystemsPortal.Properties.Settings.Default.GLInterfaceUploadFolder; if (chunkData.chunkIndex == 0) { //1st chunk - check if file exists, and if so, delete before saving path = Path.Combine(uploadFolder, chunkData.fileName); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } } path = String.Empty; // The Name of the Upload component is "files" if (files != null) { foreach (var file in files) { path = Path.Combine(uploadFolder, chunkData.fileName); AppendToFile(path, file.InputStream); } } Models.FileResult fileBlob = new Models.FileResult(); fileBlob.uploaded = chunkData.totalChunks - 1 <= chunkData.chunkIndex; fileBlob.fileUid = chunkData.uploadUid; return Json(fileBlob); }The control definition is:-
@(Html.Kendo().Upload().Name("files").Multiple(false).Events(e => e.Success("ulSuccess")).Async(a => a .Save("ChunkSave", "GLInterfaceUpload") .ChunkSize(250000) .AutoUpload(true)))
function ulSuccess(e) {
var response = e.XMLHttpRequest.responseText;
fileID = response;
alert(fileID);
e.sender.enable(false);
$('#divButton').show();
}
The Success event does fire, but the data returned, but as the Save procedure has never been called, no fileID is passed back.
How can I get this working as it should?
Thanks

Hello. I am trying to find a way to Expand/Collapse columns for a Kendo Grid in MVC. I see this implementation for js:
https://docs.telerik.com/kendo-ui/knowledge-base/grid-expand-collapse-columns-group-button-click
But I would like to find the same functionality example for MVC please.
.ClientTemplate() is not working inside the child grid. I'm also posting the example explaining the issue.
This is the Parent grid:
@(Html.Kendo().Grid(Model.DeliquencRulesGridVM)
.Name("deliquencRulesGridVM")
.Columns(columns =>
{
columns.Bound(c => c.Id).Hidden();
columns.Bound(c => c.RuleNumber)
.Title(@AonWrapStringResources.Deliquency_Label_RuleNumber)
.Width(200)
.HtmlAttributes(new { })
.Filterable(f => f.Extra(false)
.Messages(m => m.Info(@StringResources.Generic_GridFilter_Refine + " " + @AonWrapStringResources.Deliquency_Label_RuleNumber + ":")));
})
.ClientDetailTemplateId("deliquency-grid")
.Events(e => e
.DataBound("delinquency.gridDataBound")
)
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(10)
.Model(model =>
{
model.Id(p => p.Id);
})
.ServerOperation(false)
)
.Resizable(resize => resize.Columns(true))
.Deferred()
)
And this is the child grid in which .ClientTemplate() is not working.
<script id="deliquency-grid" type="text/kendo-tmpl">
<div id="DeliquencyFollowUpGrid">
<div class="grid-outside">
@(Html.Kendo().Grid(Model.DeliquencFollowUpGridVM)
.Name("deliquencFollowUpGridVM")
.Columns(columns =>
{
columns.Bound(c => c.Active)
.Title(@AonWrapStringResources.BrowseProgram_Label_Active)
.Template(@<text></text>)
.HtmlAttributes(new { @class = "text-center" })
.ClientTemplate("Hello")
.Width(102);
})
.Events(e => e
.DataBound("delinquency.gridFollowUpDataBound")
)
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(10)
.Model(model =>
{
model.Id(p => p.Id);
})
.ServerOperation(false)
)
.Resizable(resize => resize.Columns(true))
.Deferred()
.ToClientTemplate()
)
</div>
</div>
</script>
Could you please help me on this. It would be much appreciated if you can help me on this.

I have created a bar chart which has data of about thousand objects. Objects have both positive and negative values. When the chart is initially rendered all the labels are displayed properly. If there are only positive or only negative values and even when I scroll along Y axis, then labels are clearly seen for all the bars. But if both positive and negative values are there in the chart and as I scroll along Y axis, labels start disappearing. I don't understand why such behaviour is seen. I am not using any custom function to render labels. Just
categoryAxis:
labels: {
rotation: 'auto',
position: 'start'
}