kendo-grid

How to use Kendo UI Grid with ToDataSourceResult(), IQueryable<T>, ViewModel and AutoMapper?

牧云@^-^@ 提交于 2019-12-03 06:07:58
问题 What is the best approach to load/filter/order a Kendo grid with the following classes: Domain: public class Car { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual bool IsActive { get; set; } } ViewModel public class CarViewModel { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string IsActiveText { get; set; } } AutoMapper Mapper.CreateMap<Car, CarViewModel>() .ForMember(dest => dest.IsActiveText, src =>

Format DateTime in Kendo UI Grid using asp.net MVC Wrapper

懵懂的女人 提交于 2019-12-03 05:35:55
问题 I want to build a Kendo UI Grid with format date dd//MM/yyyy. However, all questions that I found about this, it were resolved with code Format("{0:d}"); . So, I have tried like a code below: GridBoundColumnBuilder<TModel> builder = par.Bound(field.Name); switch (field.Type.Type) { case CType.Boolean: builder = builder.ClientTemplate(string.Format("<input type='checkbox' #= {0} ? checked='checked' : '' # disabled='disabled' ></input>", field.Name)); break; case CType.Datetime: builder =

How can I refresh the grid after I edit the Kendo UI grid?

与世无争的帅哥 提交于 2019-12-03 05:33:36
问题 I edit the grid using editable: "popup" as shown on Telerik's demo page. After I edit the grid, I want the grid to refresh. Does the grid have any event that is called after I edit the grid? I tried to use the databound event. In this event I make the datasource read, but it tells me it is an infinite loop to refresh the grid. I tried to use the saveChanges event, but it is not working. @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>() .Name("grid") .Columns(columns => {

Send Additional Parameter in Kendo Grid Read Action

大城市里の小女人 提交于 2019-12-03 05:03:34
I have a kendo Grid as follows. @(Html.Kendo().Grid<RevenueModel>() .Name("WeeklyRevenue") .Resizable(resizing => resizing.Columns(true)) .Columns(columns => { columns.Bound(p => p.Number).Width(100); columns.Bound(p => p.Type).Width(100); columns.Bound(p => p.Week1).Format("{0:c}"); columns.Bound(p => p.Week2).Format("{0:c}"); columns.Bound(p => p.Week3).Format("{0:c}"); columns.Bound(p => p.Week4).Format("{0:c}"); columns.Bound(p => p.Week5).Format("{0:c}"); columns.Bound(p => p.TotalRevenue).Format("{0:c}"); }) .Scrollable() .Events(events => events.Change("onChange").DataBound("onDataBound

How can I refresh a grid data source using angular Kendo UI

大城市里の小女人 提交于 2019-12-03 02:43:44
I am combining Telerik Kendo grid with Angular using the Angular Kendo UI project. I have the following markup: <div kendo-grid="" k-options="thingsOptions" style="height: 600px;" /> and the following code in my controller: $scope.thingsOptions = { dataSource: { type: "json", transport: { read: "/OM/om/getAssets", dataType: "json" }, schema: { model: { id: "ProductID", ... This all works fine however I would like to force a data source refresh of my grid from my controller. something like $scope.getTasks = function() { $scope.thingsOptions.dataSource.read(); }; Is this possible to do from the

KendoUI Grid Decimal number column

无人久伴 提交于 2019-12-03 01:42:35
I have a column for weight (in Kg). When the user clicks on it I need to enable them to be able to put in decimal number with 3 places. The problem I have is at the moment it only allows them to put it in to 2 places, but shows as 3 places. You can type in a number to many decimal places but when it saves it will round it to 2 places. My column is set up like so: ... { field: "weight", title: "Weight", width: 40, format: "n4", decimals: 4, step: 0.001, template: "#= weight.toFixed(3)+'kg' #" } ... I have tried a few things but none work. Several questions (afaik): Format in columns is not

Kendo UI Grid returns JSON to browser (using MVC)

荒凉一梦 提交于 2019-12-02 21:42:36
问题 I've recently purchased a Kendo subscription, I'm having trouble getting an AJAX bound grid to operate as expected, hoping someone here can help. I have followed the Kendo docs tutorial @ http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding and could get the AJAX binding working nicely. I've tried to now implement it into an existing MVC solution, and whenever I click the New or Edit command button, I get a string of JSON returned to the browser .

Kendo Grid Edit InLine Custom Validation message e.g. for duplicate Names etc

假如想象 提交于 2019-12-02 20:57:45
I have an entity Location and I am using the Kendu UI Grid with InLine edit mode. The entity owns a property DisplayName , which is required and must not exist twice in the database. At the moment, it works to display the Required Validation message: And it also works to build up a method CustomValidateModel called in the LocationController Ajax InLine Create method, that checks if the Name is already existing in the database and adds then a ModelError . I catch this error then in the .Events(events => events.Error("onError")) via javascript and show then the message via javascript popup.

Format DateTime in Kendo UI Grid using asp.net MVC Wrapper

≯℡__Kan透↙ 提交于 2019-12-02 20:07:48
I want to build a Kendo UI Grid with format date dd//MM/yyyy. However, all questions that I found about this, it were resolved with code Format("{0:d}"); . So, I have tried like a code below: GridBoundColumnBuilder<TModel> builder = par.Bound(field.Name); switch (field.Type.Type) { case CType.Boolean: builder = builder.ClientTemplate(string.Format("<input type='checkbox' #= {0} ? checked='checked' : '' # disabled='disabled' ></input>", field.Name)); break; case CType.Datetime: builder = builder.Format("{0:d}"); break; case CType.Decimal: case CType.Double: builder = builder.Format("{0:0.00}");

kendo ui Editable color input field on grid

谁都会走 提交于 2019-12-02 19:49:15
问题 As you can see in the code below, i have a grid with editable cells. At the column named "szin" i tired to implement a kendo colorpicker and it works just fine. My problem is, that the colors are only displayed when you try to edit one of the cell. Can i make it permanently displayed somehow? I dont care if the bg-color of the cell change or the dropdown box visible all the time or with any other methods. Here's my code: <!DOCTYPE html> <html> <head> <link href="../styles/kendo.metro.min.css"