kendo-asp.net-mvc

How do you set the data function for a Kendo DataSource using the Razor HTML Helpers?

北城以北 提交于 2019-12-11 12:41:21
问题 I'm trying to get the Kendo UI for ASP.NET MVC grid control working with a WebApi controller using OData queries. I would prefer to emit the relevant javascript using the Html helpers but I'm struggling to emit the equivalent of this: schema: { data: function (data) { return data; } } I've tried this: .Schema(schema => schema.Data((object data) => { return data; })) But I'm getting Error: 'Kendo' is undefined in IE and the actual JS emitted is: "schema":{"data":Kendo.Mvc

Bootstrap columns inside Kendo Tabstrip

a 夏天 提交于 2019-12-11 12:19:55
问题 I have a Kendo Tabstrip and I'm trying to format its content using Bootstrap. But Tabstrip's border, k-content k-state-active , is rendered at top and my elements are outside. If I don't use Bootstrap, everything will be fine. I have already read this question and it doesn't solve my problem. This is my code: <div> @(Html.Kendo().TabStrip() .Name("tabstrip") .Items(items => { //removed items.Add() .Text("اطلاعات حساب‌ها") .Content(@<text> <div class="form-group form-inline col-xs-12"> <div

How can I access the model for the selected item in a Kendo UI Grid

旧巷老猫 提交于 2019-12-11 12:05:52
问题 I have a selectable kendoUI grid in my ASP.NET MVC app. How do I get the strongly typed model object for the selected item? I have tried the following code but it doesn't work. @(Html.Kendo().Grid<Backup>(Model.Backups) .Name("MatchingBackupsGrid") .Columns(col => { col.Bound(backup => backup.BackupUId).Title("UID"); col.Bound(backup => backup.BackupFirstName).Title("First Name"); col.Bound(backup => backup.BackupLastName).Title("Last Name"); }) .Scrollable() .Selectable(sel => { sel.Mode

Update rows from grid and database with Kendo UI and MVC

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:38:03
问题 I'm using a MVC project with Visual Studio 2012 and Kendo UI 2014. I can update a row from the grid and it changes, but when I reload the page, the row appears with the original info. I would like to update it in the database too . This is my code: .cshtml (View): <div class="grid"> @(Html.Kendo().Grid<UsersModel>() .Name("grid") .Editable(editable => editable.Mode(GridEditMode.InCell)) .DataSource(dataSource => dataSource .Ajax() .Model(r => r.Id(p => p.Id)) .Read(r => r.Action("GetAccounts"

How to add a tooltip based on a DropDown list with Kendo wrappers?

家住魔仙堡 提交于 2019-12-11 09:33:03
问题 DropDownList: @(Html.Kendo().DropDownList() .Name("ddlRoles") .OptionLabel("ACCOUNT TYPE") .HtmlAttributes(new { @class = "ddlRoles" }) .BindTo((IEnumerable<SelectListItem>)ViewBag.ApplicationRoles) ) ToolTip @(Html.Kendo().Tooltip() .For("#help-tooltip") .Position(TooltipPosition.Top) .Content("Hello") ) The content "Hello" I want it to base it on the item selected on ddlRoles 回答1: @(Html.Kendo().DropDownList() .Name("ddlRoles") .OptionLabel("ACCOUNT TYPE") .HtmlAttributes(new { @class =

Model Binding fails with Kendo Grid

心不动则不痛 提交于 2019-12-11 09:03:33
问题 I can't use edit and create command of a Kendo Grid, because binding always fails and controller always receives a null object, even though DataSourceRequest is fine. I used a @html.EditorForModel() and it worked fine and controller received the data. So MVC Model binding and my class aren't the problem. Also, using F12, I can see the data being posted and it's fine too. Any Idea about possible problem and debugging? There is an issue with all of my Kendo Grids, sometimes they post a model

Set the selected text or value for a KendoDropDownList

╄→尐↘猪︶ㄣ 提交于 2019-12-11 06:58:10
问题 I'm using Durandal and Kendo UI. My current problem is the edit popup event on my grid. I cannot seem to set the selected value on my dropdown. I can debug and inspect, and I indeed do see the correct value of e.model.InstrumentName nicely populated. How can I set the value/text of those dropdowns in edit mode ? Here's my grid init: positGrid = $("#positGrid").kendoGrid({ dataSource: datasource, columnMenu: false, { field: "portfolioName", title: "Portfolio Name", editor:

Set/Modify Title in kendo mvc grid?

一曲冷凌霜 提交于 2019-12-11 05:15:46
问题 I'm trying to get hold of column bound info . so that i can add few settings(Width,Title etc) to Kendo grid where columns are created on fly . Code: @(Html.Kendo().Grid<dynamic>().Name("Grid").AutoBind(false) //model is dynamic .Columns(columns => { for (int index = 0; index < Model.mycolumns.Count; index++) { var item = Model.mycolumns.ElementAt(index); columns.Bound(item.Value, item.Key).Title("Test").Filterable(false); // Title setting ignored } }); when i set filterable false or Title to

How to show time format(HH.MM.SS) in Kendo chart Y-axis

徘徊边缘 提交于 2019-12-11 05:15:35
问题 I have following JSON format, [{ day: "YYY", avgSecond: "100", waitSecond: "125"}, {day: "XXX", avgSecond: "145", waitSecond: "117"} ,{day: "TTT", avgSecond: "565", waitSecond: "340"},{day: "SSS", avgSecond: "125", waitSecond: "250"}]; I need to show this data in kendo chart as, avgSecond and waitSecond in HH.MM.SS format in chart Y-axis and day in X-axis , My code as follows, <div id="AvgChart"></div> var seriesData = [{ day: "YYY", second: "100", age: "125" }, { day: "XXX", second: "145",

Drag and drop between two kendo grids

纵饮孤独 提交于 2019-12-11 05:07:01
问题 Drag and drop between two grids Problem with saving <div id="gridexample1" style="width:800px"> <div id="grid1"></div> <div id="gridexample2" style="width:800px"> <div id="grid2"></div> $(document).ready(function () { var dataSource1 = new kendo.data.DataSource({ data: [ { "ID": 1, "Name": "Roosetty" }, { "ID": 2, "Name": "timcook" }, { "ID": 3, "Name": "Sam" }, ], pageSize: 5 }); var dataSource2 = new kendo.data.DataSource({ data: [ { "ID": 4, "Name": "steve" }, { "ID": 5, "Name": "mark" },