kendo-asp.net-mvc

Kendo Grid populates and posts all of the navigation properties

早过忘川 提交于 2019-12-25 02:53:46
问题 I have a Kendo UI Grid which uses the Serial class as its model. This class has relation with the row class, but I don't use any of the navigation properties in my Grid and I don't need them in this particular page. The problem is, Kendo UI populates all of the foreign key relations. So the row class and all of the navigation properties of itself will be populated. When I try to save my edit, Kendo posts all of these data and this causes ModelState.IsValid always be false . Do you have any

Wrong currency unit in Kendo

你。 提交于 2019-12-24 15:08:41
问题 In my website I use the Kendo-grid. In that grid, there is a column "Amount" with these values: You see that there are dollar-signs before the amounts, but I want euro-signs. The globalization-culture settings are correct, because when I show an amount outside the grid, it shows me the amount with a euro-sign. I'm developing this website with ASP.NET MVC5. In my model I have this property: [DisplayFormat(DataFormatString = "{0:c}")] public decimal Amount { get; set; } You see that I format my

How to add in KendoUI MVC Grid a thousand comma separator

浪子不回头ぞ 提交于 2019-12-24 12:51:24
问题 I want to display 1000 like 1,000 in Grid (Must have commas). Initial data type is string. I need thousand comma separator. I have the same questions as in How to change display format of long variable?. But my data type is string. In this topic they did not have clear answer for KendoUI MVC Grid for thousand comma separator. I have KendoUI Grid @(Html.Kendo().Grid((IEnumerable<MyApp.Models.MyModel>)ViewBag.QualReq) .Name("MyGrid") .Columns(columns => { columns.Bound(p => p.Actual); })

KendoUI Grid with MVC Wrappers and Web API

余生长醉 提交于 2019-12-24 12:12:46
问题 I'm using Kendo UI grid with ASP.Net MVC Wrappers. My grid datasource is defined as follows: .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(p => p.Code); }) .Read(read => read.Url("api/ProjectMilestone").Type(HttpVerbs.Get)) .Create(create => create.Url("api/ProjectMilestone").Type(HttpVerbs.Post)) .Update(update => update.Url("api/ProjectMilestone").Type(HttpVerbs.Put)) .Destroy(destroy => destroy.Url("api/ProjectMilestone").Type(HttpVerbs.Delete)) ) So one would

How can we implement select All option in Kendo MultiselectFor

孤人 提交于 2019-12-24 12:09:22
问题 How can we implement select all option in Kendo Multiselect For? @(Html.Kendo().MultiSelectFor(model => model.TestData) .DataTextField("DataText") .DataValueField("DataValue") .Placeholder("Select..") .Events(e => e.DataBound("CheckIfEmpty")) .AutoBind(false) .Enable(false) .DataSource(source => { source.Read(read => { read.Action("Action", "Controller").Data("filterData"); }) .ServerFiltering(false); }) ) 回答1: Please check below code snippet. <!DOCTYPE html> <html> <head> <meta charset="utf

Kendo Grid MVC: default filter for string fields is set to “is equal to”

烂漫一生 提交于 2019-12-24 09:37:27
问题 Kendo Grid has default filter for "dt" field "is equal to" with calendar. For "name" field it has default filter "is equal to", but I want to move "Contains" to a first place of an option list and make it default for strings. How could it be implemented? public class MyClass { public DateTime dt { get; set; } public string name { get; set; } } @(Html.Kendo() .Grid<MyClass>() .Name("grid") .DataSource(data => data.Ajax() .ServerOperation(false) .Read(read => read.Action("MyAction",

Export hidden fields to Excel using KendoGrid throw error

拥有回忆 提交于 2019-12-24 08:23:17
问题 I have a button Export Excel: <script type="text/x-kendo-template" id="template"> <div class="toolbar"> <button id="ExportExcel" class="btn btn-default " onclick="ExportExcel(); return false;"><i class="fa fa-file-excel-o"></i> Exportar</button> </div> </script> Normally I have a function to Export Excel like this: function ExportExcel() { $("#lstEmployees").data("kendoGrid").saveAsExcel(); // export grid to excel } And below I populate grid like this: function onPageOperationsSuccess

Unable to populate Kendo Scheduler with Data

孤人 提交于 2019-12-24 06:32:57
问题 First time using MVC and Kendo Scheduler and I can't get the data to show on the Calendar. I have the below Model public class Events : ISchedulerEvent { public int Id { get; set; } public string Description { get; set; } public DateTime End { get; set; } public string EndTimezone { get; set; } public bool IsAllDay { get; set; } public string RecurrenceException { get; set; } public string RecurrenceRule { get; set; } public DateTime Start { get; set; } public string StartTimezone { get; set;

Opening multiple windows with Kendo menu

六眼飞鱼酱① 提交于 2019-12-24 04:06:04
问题 I have a kendo menu and I'd like each menu to open a new window. How can I achieve that? This is my current code in _layout : <div class="k-rtl"> @(Html.Kendo().Menu() .Name("menu") .Items(items => { items.Add().Text("Menu 1").Items(child => { child.Add().Text("1").LinkHtmlAttributes(new { onClick = "menu('1');" }); child.Add().Text("2"); }); }) ) </div> <script> function menu(text) { var window = $("#win1").data("kendoWindow"); switch (text) { case "1": window.refresh({ url: "@Url.Action(

Opening multiple windows with Kendo menu

巧了我就是萌 提交于 2019-12-24 04:05:13
问题 I have a kendo menu and I'd like each menu to open a new window. How can I achieve that? This is my current code in _layout : <div class="k-rtl"> @(Html.Kendo().Menu() .Name("menu") .Items(items => { items.Add().Text("Menu 1").Items(child => { child.Add().Text("1").LinkHtmlAttributes(new { onClick = "menu('1');" }); child.Add().Text("2"); }); }) ) </div> <script> function menu(text) { var window = $("#win1").data("kendoWindow"); switch (text) { case "1": window.refresh({ url: "@Url.Action(