when using
<script src="~/Scripts/kendo/kendo.all.min.js" type="text/javascript"></script>
<script src="~/Scripts/kendo/kendo.aspnetmvc.min.js" type="text/javascript"></script>
we get the below mentioned exception:
Illegal characters in path.
~/Content/kendo/fonts/DejaVu/DejaVuSans-Bold.ttf) format("truetype"
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=Illegal characters in path.
Source=mscorlib
StackTrace:
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2)
at System.Web.Configuration.UserMapPath.GetPhysicalPathForPath(String path, VirtualDirectoryMapping mapping)
at System.Web.Configuration.UserMapPath.GetPathConfigFilename(String siteID, VirtualPath path, String& directory, String& baseName)
at System.Web.Configuration.UserMapPath.MapPath(String siteID, String path)
at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull)
at System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull)
at System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp)
at System.Web.HttpContext.GetFilePathData()
at System.Web.HttpContext.GetConfigurationPathData()
at System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context)
at System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request)
at System.Web.HttpRequest.get_Browser()
at System.Web.HttpResponse.ApplyRedirectQueryStringIfRequired(String url)
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at FastStart.Web.Global.Application_Error(Object sender, EventArgs e) in C:\svn\newrxrequest\FastStart\Refactor\branches\20151018\FastStart.Web\Global.asax.cs:line 105
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.HttpApplication.RaiseOnError()
InnerException:

I am getting the following error when I am pressing the Edit button for the ListView. I am not sure why. The Data from the model appears and I can edit the input fields but it does not call the Update method on the controller.
Uncaught SyntaxError: Unexpected identifiervt.getter @ kendo.all.min.js:9ut.extend.get @ kendo.all.min.js:11S.extend.get @ kendo.all.min.js:12E.widget.value.v.extend.init @ kendo.all.min.js:12b.extend.applyBinding @ kendo.all.min.js:13I.extend.bind @ kendo.all.min.js:13a @ kendo.all.min.js:12a @ kendo.all.min.js:12a @ kendo.all.min.js:12a @ kendo.all.min.js:12a @ kendo.all.min.js:12s @ kendo.all.min.js:12c.extend.refresh @ kendo.all.min.js:26c.extend.init @ kendo.all.min.js:26(anonymous function) @ kendo.all.min.js:10b.extend.each @ jquery.min.js:3b.fn.b.each @ jquery.min.js:3vt.plugin.e.fn.(anonymous function) @ kendo.all.min.js:10n.ui.DataBoundWidget.extend.edit @ kendo.all.min.js:33(anonymous function) @ kendo.all.min.js:33b.event.dispatch @ jquery.min.js:3b.event.add.v.handle @ jquery.min.js:3
MVC Code for the ListView
@(Html.Kendo().ListView<RPMS.Models.ActualsHoursViewModel>(Model) .Name("ListView") .TagName("div") .ClientTemplateId("ActualsHoursTemplate") .DataSource(dataSource => dataSource .Model(model => { model.Id(m=>m.ActualsHoursModelsId); model.Field(m => m.ProjectId); model.Field(m => m.HoursAllocated); model.Field(m => m.Activities); } ) .ServerOperation(true) .Batch(true) .Create(create => create.Action("kendo_Create", "ActualsHours")) .Read(read => read.Action("kendo_Read", "ActualsHours", new { date = "" })) .Update(update => update.Action("kendo_Update", "ActualsHours")) .Destroy(destroy => destroy.Action("kendo_Destroy", "ActualsHours")) .Events(events => events.Error("error_handler")) ) .Editable() .Events(ev => { ev.DataBound("initDropDownLists"); } ) .Selectable() // .Events(events => events.Error("error_handler")))
Correct data is returned from the server, and it seems to be paging correctly, but I get a big empty dropdown list. What am I doing wrong? As far as I can tell, this code matches the code from the demo. Using v.2015.2.805.545.
Controller:
public ActionResult GetCustomers([DataSourceRequest] DataSourceRequest request) { var customers = Context.Customers.Where(c => c.DateDeleted == null); var results = customers.ToDataSourceResult(request, ModelState, c => new CustomerSelectListItem(c)); return Json(results, JsonRequestBehavior.AllowGet);}public ActionResult CustomersValueMapper(int[] values) { //this method exists to get a concrete "row number" for the value(s) in question. // //to fulfill this requirement, we're using List's FindIndex method over a collection of all customers stored in the Session // var indices = new List<int>(); var customers = GetAllCustomers(); if (values != null) { //add all customers with indices >= 0 indices.AddRange(values.Select(value => customers.FindIndex(c => c.Id == value)) .Where(index => index >= 0)); } return Json(indices, JsonRequestBehavior.AllowGet);}private List<Customer> GetAllCustomers() { if (Session["allCustomers"] == null) { Session["allCustomers"] = Context.Customers.Where(e => e.DateDeleted == null).ToList(); } return (List<Customer>)Session["allCustomers"];}
Javascript:
function valueMapper(options) { console.log("valueMapper: options.value = " + options.value); $.ajax({ url: "@Url.Action("CustomersValueMapper", "Equipment", new {area="Dispatch"})", data: convertValues(options.value), success: function (data) { options.success(data); }});}function convertValues(value) { var data = {}; value = $.isArray(value) ? value : [value]; for (var idx = 0; idx < value.length; idx++) { data["values[" + idx + "]"] = value[idx]; } return data;}
View:
@(Html.Kendo().DropDownList() .Name("customerId") .DataValueField("Value") .DataTextField("Text") .DataSource(ds => ds.Custom() .ServerPaging(true) .PageSize(80) .Type("aspnetmvc-ajax") //uses DataSourceRequest .Transport(transport => transport.Read("GetCustomers", "Equipment", new { area = "Dispatch" })) .Schema(schema => schema .Data("Data") .Total("Total")) ).Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper")))Hello everyone.
I am doing a proof of concept with telerik mvc grid controls and am in the following situation.
1. Using the Kendo Grid i am trying to do the following..
a Popup Edit screen with a Custom template with a dropdown list that calls the controller for additional info.
Here is the code i have so far
columns.ForeignKey(p => p.CASH_ISIN_CHR, (System.Collections.IEnumerable)ViewData["cashisnnames"], "ISIN_CHR", "Name_CHR").Title("CASH ISIN").EditorTemplateName("CashISINEditor"); columns.ForeignKey(p => p.CURRENCY_ISIN_CHR, (System.Collections.IEnumerable)ViewData["currencyisnnames"], "ISIN_CHR", "Name_CHR").Title("CURRENCY ISIN").EditorTemplateName("CurrencyISINEditor"); columns.Bound(c => c.Units_INT).Title("UNITS"); columns.Bound(c => c.Local_Amount_DEC).Title("Local Amt"); columns.Bound(c => c.Trade_DATE).Format("{0:d}").Title("Trade Date"); columns.Bound(c => c.Settlement_DATE).Format("{0:d}").Title("Settle Date"); columns.Bound(c => c.Custodian_Reference_Num_CHR).Title("Cust. Ref #"); columns.Bound(c => c.Entered_DNT).Format("{0:d}").Title("Entered Date"); columns.Bound(c => c.FX_Rate_DEC).Title("FX Rate"); columns.Command(command => { command.Edit(); }).Width(180);}).ClientDetailTemplateId("template").ToolBar(toolbar =>{ toolbar.Excel(); toolbar.Pdf();}).Excel(excel => excel.FileName("Transaction Master Export.xlsx").AllPages(true)).Pdf(pdf => pdf.AllPages()).ColumnMenu().HtmlAttributes(new { style = "height:750px;" }).Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("CustomTransactionMasterEditor")).Pageable()I have an editor template called CustomTransactionMasterEditor and the code in it looks like this:
@model BetaSMTRApp.Models.Transaction_Master<h3>Custom Transaction Master</h3>@Html.TextBoxFor(model => model.FUND_INT).ToString() @Html.TextBoxFor(model => model.TYPE_CHR)@(Html.Kendo().DropDownListFor(m => m) .Name("cashisndd") .DataValueField("ISIN_CHR") .DataTextField("Value") .DataSource(ds => ds .Read(read => read.Action("GetCASHISIN", "TransactionMaster", new { FundInt = 223, TypeChr = "Expense" }) ))In the TextBoxFor fields i am getting fund int and type chr... both of which i need to pass in the .Read on the data source line. When i try to use Model it is null.
How can i get the textbox for value into the new section of the .Read?
Thanks,
Corey
Hi,
Here's a question what event or function is called when the user presses the cancel or close button on the mvc grid popup editor.
Best,
A. Guzmán
Hello,
selecting a DropDownList inside of a window-control results in a scrollbar on the side of the window-control. How can I prevent that?
I attached a screenshot so you can see what I am talking about.
Thanks in advance.
Assuming I have the below table:
@Html.Kendo().Grid(Model).Name("Staff").Columns(x =>{ x.Bound(y => y.StaffId); x.Bound(y => y.FirstName); x.Bound(y => y.LastName); x.Bound(y => y.Email); x.Bound(y => y.Phone); x.Command(y => y.Custom("Edit").Action("edit", "controller", new { id = ????? }));}).Sortable().Scrollable().Pageable(x=> x.PageSizes(true)).Filterable()
How can I pass the primary key value (StaffId in this case) associated to the row to the object route values similar to the way it is done by Visual Studio auto-scaffold? I do not want a Java Script based solution. I am just looking for a way to pass the current row id (PK) to server action. Is it possible?
For more information please refer this SO thread.