Hello to all.
I have a scheduler with a Custom Editor.
A model with the member Image (string)
I'd like to use an Upload control in order to
1) upload the image on the server, by sending also the calendarID in case of editing an existing calendar event
2) on Save, store the file name in the Image member of the model.
At the moment I'm able to insert an Upload control in the custom Editor, but I'm not able to store the filename in the Model member (via MVVM)
Is this possible?
Should I use the "save event" of the calendar to discover the current value of the Upload control and update the model (how is possible to update the model ???)
Thanks.
My code:
member of the Model:
[Display(Name = "Logo")]public string Image { get; set; }
Custom Editor:
(NB: calendarID should be the ID of the current calendar in case of editing, but I don't know how :-( )
Thanks!!!
<div class="k-edit-label"> @(Html.LabelFor(model => model.Image))</div><div data-container-for="Image" class="k-edit-field"> @(Html.Kendo().Upload() .HtmlAttributes(new { accept = "image/*" }) .Name("calendarImages") .Async(async => async .Save("SaveImage", "Calendar", new { calendarID = 1 }) .Remove("RemoveImage", "Calendar", new { calendarID = 1 }) .AutoUpload(true) ) .Multiple(false) )</div>I'd like to create a grid based on a ViewModel type like you normally would:
@(Html.Kendo().Grid<BlockoutPeriodVM>() .Name("BlockoutWeeks") .Columns(columns => { columns.Bound(b => b.Name).Title("Name"); columns.Bound(b => b.StartDate).Title("Start Date").Format("{0:d}"); columns.Bound(b => b.EndDate).Title("End Date").Format("{0:d}"); columns.Template(@<text>[buttons]</text>).Title("Edit").ClientTemplate(@"#= crm.setup_classSchedule_edit.getBlockoutCommandTemplate(data) #"); }))
but I want to manage the data that it is bound to myself, on the client-side. In my script, I will deserialize an array of BlockoutPeriodVMs and would then like to set that array as the datasource of the grid. I will also offer CRUD support for this array outside of the grid so I'm hoping the Grid/datasource can make the array an observable array and update according to any changes I make. I found this old thread asking the same thing for jQuery Kendo UI, but is there a way to set the read action to a function like that using the MVC Html helper?
I try to use drag and drop/select from file folder to upload multiple files. It does not act the way as your demo does. It can not select multiple files. It can not drag and drop. The drag and drop region does not show.
Here is the code in the Upload.cshtml page:
@using (Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data", id = "form" }))
{
<div class="form-input">
<div>
The Upload can be used as a drop-in replacement
for file input elements.
</div>
<div>
@(Html.Kendo().Upload()
.Name("attchments")
.Async(a => a
.Save("Upload", "Home")
.Remove("RemoveUpload", "Home")
.AutoUpload(true))
))
</div>
<p style="padding-top: 1em; text-align: right">
<button type="submit" class="k-button k-primary">Submit</button>
</p>
</div>
}
In _Layout.cshtml page, I have the following links:
<link href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2018.1.221/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2018.1.221/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2018.1.221/kendo.default.mobile.min.css")" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />
<script src="https://kendo.cdn.telerik.com/2018.1.221/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.1.221/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.1.221/js/kendo.aspnetmvc.min.js"></script>
<script src="@Url.Content("~/Scripts/kendo/2018.1.221/jszip.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
What do I missed?
Thanks in advance for your help!
Anieda
Hi,
I'm using the MVC TreeList with remote data loading.I have the latest column to be a checkbox, but I have an issue when the node is expanded. After expanded, all of the nodes below in the same tier get unchecked, even if they were checked before that. Here is a video of the problem.
https://www.screencast.com/t/zt234VFtdLEO
Am I doing something wrong?
This is the code for the tree list:
@(Html.Kendo().TreeList<TreeEntity<Organization>>()
.Name("treelist")
.Columns(columns =>
{
columns.Add().Field(e => e.Value.Id).Width(280).Title("ORG ID");
columns.Add().Field(e => e.Value.Name).Width(280).Title("ORGANIZATION NAME");
columns.Add().Field(e => e.Value.ActiveFlag).Width(60).Title("ACTIVE");
columns.Add().Width(60).Title("SELECT").TemplateId("cbx-template");
})
.DataSource(dataSource => dataSource
.Read(read => read.Action("OrganizationsTree_Read", "Home"))
.Model(m =>
{
m.Id(f => f.Id);
m.ParentId(f => f.ParentId).DefaultValue(null);
m.Field(f => f.Value.Id);
m.Field(f => f.Value.ParentId);
})
)
.Events(events => { events.DataBound("onTreeDataBound"); events.Expand("onTreeExpand"); })
.Height(540)
)
DataBound and Expand are JS methods without any code except console.log(arg).
Thank you
Hello,
I am trying to add (css: border-color:red) to MaskedTextBox when field is required on submit function but I couldn't find this class. What is name of this class?
Also, I need to remove this class if the customer click on Save button that can skip validations.
Thank you for help.
Hi there, I am just trying to install the MVC 5 version from the private nuget feed. Everytime I try to install it, it freezes Visual Studio, any of them. I've tried in 2012, 2013, and 2015. Same thing always happens. When I check the project, the package installs the Scripts and the fonts folder, no editor templates or content.
The output says Installing Telerik.UI.xxx.MVC5xxx, adding package Telerik.UI.MVC5. Added package Telerik.UI.MVC5, and that's where it freezes.
I cannot use the telerik template creators because I want to add kendo UI to my existing projects. Nuget package is the best way. I tried downloading the nuget package too and installing it that way, still same freeze. What is going on? Thanks.
Here is my Razor grid markup...
@(Html.Kendo().Grid<Karpos.WebUI.Models.HolidayDinnerModel>(Model) //Bind the grid to ViewBag.Products
.Name("grid")
.Columns(columns =>
{
columns.Bound(model => model.PLU).Groupable(true);
columns.Bound(model => model.Name);
})
.Pageable() //Enable the paging.
.Sortable() //Enable the sorting.
.Groupable()
)
The grid loads with data correctly but when I try to drag the PLU column to the Head to group on PLU, it is greyed out. All columns are the same way.
Any help?


HI, I work on a project that uses Kendo MVC widget. I install it from the Telerik Nuget Source and add: Telerik.UI.for.AspNet.Mcv5 Version 2018.2.704. All work great until I need to use ForeignKey column in my grid. The drop-down list does not appear. I look on Google and someone says that I need to add the EditroTemplates views under Views/Shared in my MVC project. So I took the one in your demo at this location C:\Program Files (x86)\Progress\Telerik UI for ASP.NET MVC R2 2018\wrappers\aspnetmvc\Examples\VS2017\Kendo.Mvc.Examples\Views\Shared
But Now I got this runtime error: cannot load 'System.Web.Mvc.ViewUserControl<object>'. in
Line 1 : <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<object>" %>
Line 2 :
Line 3 : <%= Html.Kendo().TextBoxFor(model => model)%>
Source file : /Views/Shared/EditorTemplates/String.ascx Line : 1
What do I missed?