kendo-ui

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 =>

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 => {

Closing a kendoui window with custom Close button within the window

旧街凉风 提交于 2019-12-03 05:31:14
I'm using Kendo UI's window component, which is similar to any modal dialog. I have a close button in it, how do I close the window upon clicking that button (instead of clicking the default 'x' button in the title bar) The content in my window is loaded from another view @(Html.Kendo().Window() .Name("window") .Title("Role") .Content("loading...") .LoadContentFrom("Create", "RolesPermissions", Model.Role) .Modal(true) .Width(550) .Height(300) .Draggable() .Visible(false) ) In that same view, I have <span id="close" class="btn btn-inverse">Cancel</span> This is what I have in my main view (the

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

kendo ui grid datasource filter date format

梦想与她 提交于 2019-12-03 03:16:28
I have a kendo grid with a date field in the datasource. When displaying the field I use a template to display the date in the UK date format 'dd/MM/yyyy'. The problem is when filtering, I don't know how to display the date filter in UK format. Another problem I am having is there is no datetime type, just date, so can only filter by dates not datetimes. Any help or ideas would be appreciated. This is the partial view (cshtml) <script type="text/javascript"> $(document).ready(function() { var date = new Date(); var dateString = date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear(

How do I change the Background color of a Kendo UI for MVC grid cell

本小妞迷上赌 提交于 2019-12-03 03:10:25
I'm developing an app using Kendo UI for MVC and I want to be able to change the background of a cell but I don't know how to get the value of the column cell background property so I can set it. @(Html.Kendo().Grid(Model) .Name("LineItems") .Events(e=> e .DataBound("LineItems_Databound") ) .Columns(columns => { columns.Bound(o => o.Ui).Title("UI").Width(20); columns.Bound(o => o.QtyOrdered).Title("Qty Ord").Width(30); columns.Bound(o => o.Nomenclature).Width(200); columns.Bound(o => o.QtyShipped).Width(20).Title("Qty Sent"); columns.Bound(o => o.QtyReceived).Width(20).Title("Qty Rx"); columns

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

How to query a local websql DB with Kendo UI

两盒软妹~` 提交于 2019-12-02 23:50:53
Forgive me if this question is too broad for SO but I'm struggling to find any examples of what I need and thought someone may be able to point me in the right direction. I'm just starting out with Kendo UI mobile and am trying to find a tutorial or any example code for creating/querying a local client side websql database within kendo ui mobile. There is nothing in the docs... Can anyone help? Thanks in advance You can create a custom transport for the Kendo DataSource. For example in transport.read you can perform a query to your websql database and return the result: var dataSource = new

Kendo UI with AngularJs: How to bind data on textbox fields when user select row in a grid

故事扮演 提交于 2019-12-02 21:37:08
问题 I am working with Kendo UI and angular grid application. In my application I define Kendo TabStrip. In first tab I have Kendo UI grid with data and second tab contains appropriate textbox fields, which are to be filled when user select some row in a grid. My grid is populated with data when load page and it work perfectly, but data binding to textbox fields not working. How to bind data on textbox fields when user select row in a grid? This is my JSON data (which is in separate file): [ { "Id