or
@(Html.Kendo().NumericTextBoxFor(m => m.Location.Latitude).Decimals(8).Min(-90).Max(90).Step(.01).Format("{0:0.########}").Events(events => events.Change("placeMarker")))kendo.format("MVVM - {1}", 12, 24); //12 - 24
should there bekendo.format("{0} - {1}", 12, 24); //12 - 24
Not very important but maybe a little bit confusing ....var dataSource = new kendo.data.DataSource({Hello friends, I'm accessing an ASP.NET WebServices that return JSON. I can see the data correctly from the server to in FireBUG: (See Below)
I am unable to fill my grid with my URL data returned.. What is my mistake?
{"d":"[{\"BalancePoint\":\"2017.000\",\"CustomerID\":\"000\",\"FirstName\":\"AA\",\"LastName\":\"ZX\"}, {\"BalancePoint\":\"224.000\",\"CustomerID\":\"001\",\"FirstName\":\"AB\",\"LastName\":\"ZY\"}, {\"BalancePoint\":\"1094.000\",\"CustomerID\":\"002\",\"FirstName\":\"AC\",\"LastName\":\"ZZ\"}]"}
<%: Html.Kendo().Grid<Thread.Data.Models.Model>() .Name("Grid") .Columns(columns => { columns.Command(command => { command.Edit(); command.Destroy(); }).Width(190).HtmlAttributes(new { style = "text-align:center;" }); columns.Bound(m => m.ModelID).Hidden(); columns.Bound(m => m.ModelName).Width(140); columns.Bound(m => m.Company).Width(160).ClientTemplate("#= (typeof Company === 'undefined') ? ' ' : Company.CompanyName #").EditorTemplateName("CompanyDropDownList"); columns.Bound(m => m.DocumentCount).Width(90).ClientTemplate("#= (DocumentCount === null) ? '0' : DocumentCount #"); columns.Bound(m => m.AlertCount).Width(90).ClientTemplate("#= (AlertCount === null) ? '0' : AlertCount #"); columns.Bound(m => m.ArticleCount).Width(90).ClientTemplate("#= (ArticleCount === null) ? '0' : ArticleCount #"); }) .ClientDetailTemplateId("jobDetailTemplate") .ToolBar(toolBar => { toolBar.Create(); }) .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine)) .HtmlAttributes(new { style = "height: 500px" }) .Pageable() .Sortable() .Scrollable() .Filterable() .Events(events => events.DataBound("dataBound")) .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false) .PageSize(2) .Events(events => events.Error("error_handler")) .Model(model => { model.Id(j => j.ModelID); model.Field(j => j.ModelID).Editable(false); model.Field(j => j.AlertCount).Editable(false); model.Field(j => j.ArticleCount).Editable(false); model.Field(j => j.DocumentCount).Editable(false); }) .Read(read => read.Action("Model_Read", "Models")) .Update(update => update.Action("Model_Save", "Models")) .Create(create => create.Action("Model_Save", "Models")) .Destroy(destroy => destroy.Action("Model_Destroy", "Models")) ) %> toolbar, editable, columns.Command in the code below I get this error on the line creating the grid.
The model item passed into the dictionary is of type 'System.Int32', but this dictionary requires a model item of type 'System.String'.
items.Add().Text("Documents").Content(obj => Html.Kendo().Grid<Thread.Data.Models.Article>()
Is this possible to achieve, or am I missing an obvious error? I saw it in a Telerik ASP.NET demo and wanted to try it here.<script id="jobDetailTemplate" type="text/kendo-tmpl"> <%: Html.Kendo().TabStrip() .Name("TabStrip_#=ModelID#") .SelectedIndex(0) .Items(items => { items.Add().Text("Articles").Content( "<div class='employee-details'>" + "<ul>" + "<li><label>Country:</label>test 1</li>" + "<li><label>City:</label>test 2</li>" + "<li><label>Address:</label>test 3</li>" + "<li><label>Home Phone:</label>test 4</li>" + "</ul>" + "</div>" ); items.Add().Text("Alerts").Content( "<div class='employee-details'>" + "<ul>" + "<li><label>Country:</label>another test</li>" + "<li><label>City:</label>1</li>" + "<li><label>Address:</label>2</li>" + "<li><label>Home Phone:</label>2</li>" + "</ul>" + "</div>" ); items.Add().Text("Documents").Content(obj => Html.Kendo().Grid<Thread.Data.Models.Article>() .Name("Articles_#ModelID#") //.Toolbar(toolbar => toolbar.Create()) //.Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine)) .Columns(columns => { //columns.Command(command => { command.Edit(); command.Destroy(); }).Width(190).HtmlAttributes(new { style = "text-align:center;" }); columns.Bound(a => a.ArticleID).Width(101); columns.Bound(a => a.ArticleName).Width(140); columns.Bound(a => a.CompanyID).Width(200); }) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("ModelArticles_Read", "Models", new { modelID = "#=ModelID#" })) .Update(update => update.Action("Article_Save", "Models")) .Create(create => create.Action("Article_Save", "Models")) .Destroy(destroy => destroy.Action("Article_Destroy", "Models")) ) .Pageable() .Sortable() .ToClientTemplate() ); }) .ToClientTemplate() %> </script>