

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?
Hi
I'm trying to setup TabStrip and its only show the first tab which i set .Selected(true) to , here is my code :
<div class="demo-section k-content"> @(Html.Kendo().TabStrip() .Name("tabstripname") .Items(tabstrip => { tabstrip.Add().Text("Bank Account") .Selected(true) .LoadContentFrom("Bank", "People", new { personid = ViewData["personid"] }); tabstrip.Add().Text("Address") .LoadContentFrom("Address", "People", new { personid = ViewData["personid"] }); tabstrip.Add().Text("ContactNumber") .LoadContentFrom("ContactNumber", "People", new { personid = ViewData["personid"] }); tabstrip.Add().Text("Email Address") .LoadContentFrom("Email", "People", new { personid = ViewData["personid"] }); }) )</div>
example of controller code :
public PartialViewResult Commercial(){ return PartialView();}
Good afternoon Admin,
How to set the hyperlink color for .AllDayEventTemplate and .EventTemplate in scheduler? When I added the style to the page, some hyperlinks color inside the scheduler still do not change.
Here is the code:
<style>
a:link { color: #0000ff; }
a:hover { text-decoration: underline; }
.k-event k-event-inverse, .k-event
a:link { color: #0000ff; }
a:hover {text-decoration: underline}
</style>
@(Html.Kendo().Scheduler<HomeTaskViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.Editable(false)
.Height(800)
.AllDayEventTemplate("<a href='" + @Url.Action("Read", "Request") + "/" + "#= RequestId #'>#= description #</a>")
.EventTemplate("<a href='" + @Url.Action("Read", "Request") + "/" + "#= RequestId #'>#= description #</a>")
.Views(views =>
{
views.DayView();
views.WorkWeekView(workWeekView => workWeekView.Selected(true));
views.WorkWeekView();
views.WeekView();
views.MonthView();
views.AgendaView();
})
.Resources(resource =>
{
resource.Add(m => m.GroupId)
.Title("Owner")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(Model.Select(x => new { Text = x.GroupName, Value = x.GroupId, Color = x.Color }));
})
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.RequestId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.GroupId).DefaultValue(1);
m.Field(f => f.Title).DefaultValue("No title");
m.RecurrenceId(f => f.RecurrenceID);
})
.Read("ReadRequests", "Home", "Scheduler")
)
)
<script type="text/javascript">
$(function () {
$(".GroupNames :checkbox").change(function (e) {
var checked = $.map($(".GroupNames :checked"), function (checkbox) {
return parseInt($(checkbox).val());
});
var filter = {
logic: "or",
filters: $.map(checked, function (value) {
return {
operator: "eq",
field: "GroupId",
value: value
};
})
};
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.dataSource.filter(filter);
});
})
</script>
What is the correct way to do it?
Thanks in advance for your help!
Anieda
I'm trying to set values to the empty model when i click add and show the custom edit template, i've set them through javascript but it doesn't show on popup window.
function onEdit(e) {
var today = new Date();
e.model.FECHA = today;
console.log(e.model)
}
Also i've set them in the model constructor but it doesn't work, the only way to set it is via javascript and delaying the script a few seconds but this solution it's not reliable
thank you

Hi dear Telerik team.
I'm trying to use grid for showing and editing grid in UTC format.
@(Html.Kendo().Grid<TelerikGridTestApp.Models.ClientViewModel>() .Name("Grid") .Columns(columns => { columns.Bound(p => p.ClientName).Title("Name"); columns.Bound(p => p.ClientBirthday).Format("{d:0}").Title("Start Date").HtmlAttributes(new Dictionary<string, object> { { "class", "utc-date" } }); columns.Command(command => { command.Edit(); }); }) .ToolBar(toolbar => toolbar.Create()) .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ClientEditor")) .Pageable(pager => pager.PageSizes(new[] { 10, 20, 30, 50 })) .Events(e => e.DataBound("onDataBound").Edit("onEdit")) .HtmlAttributes(new { style = "height: 550px;" }) .Sortable() .Scrollable() .Resizable(configurator => configurator.Columns(true)) .Filterable() .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.ClientID)) .Create(create => create.Action("Client_Create", "Grid")) .Read(read => read.Action("Clients_Read", "Grid")) .Update(update => update.Action("Client_Update", "Grid")) .Sort(configurator => configurator.Add(c => c.ClientName)) ))
I understand that when data comes to browser, it converts to local date time of the browser. So I have to convert it back to UTC date time, and paste to the CELL of the grid.
function onDataBound() { $(".utc-date").each(function () { var text = LocalToUtc($(this).text()); $(this).text(text); }); }Also I do the same for popup dialog
@model TelerikGridTestApp.Models.ClientViewModel@using (Html.BeginForm()){ @Html.ValidationSummary(true)<fieldset> <legend>Client</legend> @Html.HiddenFor(model => model.ClientID) <div class="editor-label"> @Html.LabelFor(model => model.ClientName, "Client Name") @Html.ValidationMessageFor(model => model.ClientName) </div> <div class="editor-field"> @Html.EditorFor(model => model.ClientName) </div> <div class="editor-label"> @Html.LabelFor(model => model.ClientBirthday, "Client Birthday") </div> <div class="editor-field"> @Html.Kendo().DatePickerFor(model => model.ClientBirthday).HtmlAttributes(new { @class = "kendo-utc-date" }) @Html.ValidationMessageFor(model => model.ClientBirthday) </div> @Html.HiddenFor(model => model.TimeZoneOffsetMinutes)</fieldset>}@section Scripts { @Scripts.Render("~/bundles/jqueryval");}- I change dates using "onEdit" event.
function onEdit(e) { if (e.model.isNew()) return; var datePicker = $($("input.kendo-utc-date")).data("kendoDatePicker"); var utcDate = datePicker .value(); datePicker .value(toLocal(utcDate)); var timeZoneOffsetControl = $("#TimeZoneOffsetMinutes"); timeZoneOffsetControl.val(new Date().getTimezoneOffset()) timeZoneOffsetControl.change(); }But when I press "Cancel" button or just close the dialog, the date converts back to local date in the grid. When I press "Update" button, it looks like any mechanism takes the updated date, converts it to UTC (according to my conversion) and shows on front end, but on back end I have correct date.
I figured out that the grid has a storage, and when I update the record, the grid updates the record in the storage and sends the updated record to the back end is separately. It makes sense if I update regular string or number. But What should I do in my case?

Hi,
I've just upgraded to the version 2018.2.620. I noticed that window.title no longer displays special characters correctly. For example:
In previous version, setting the title to finnish: "Viesti Phoenixistä" rendered correctly "Viesti Phoenixistä". Now the translation of ä character does not work anymore.
Are there any solutions to this?
Thanks and regards,
Viktor
I have a popup editor configured on a grid. In the editor template, I have a dropdownfor with a Read action. I need to pass the model value to the read action but it is not recognized. Can you help?
Here is the editor template:
@model Procurement.Models.Pipe
<style>
.k-edit-form-container {
width: auto;
}
</style>
<div class="panel" style="padding:5px;">
@Html.HiddenFor(m => m.MaterialId)
@Html.HiddenFor(m => m.PcsPartNum)
@Html.HiddenFor(m => m.OuterDiameter, new { id="OD", name="OD"})
<table>
<tr><td colspan="2" align="center"><h4 class="text-info"> Pipe Details</h4></td></tr>
<tr><td colspan="2" align="center"> <hr /></td></tr>
<tr>
<td width="30%">PCS Part Num</td>
<td>@Html.TextBoxFor(m => m.PcsPartNum, new { ReadOnly = "true" })</td>
</tr>
<tr>
<td>Description</td>
<td>@Html.TextAreaFor(m => m.Description, new { ReadOnly = "true", TextMode = "MultiLine", Rows = "3", Cols = "500" })</td>
</tr>
<tr>
<td>Sort Order</td>
<td>@Html.TextBoxFor(m => m.Materials_Group.SortOrder, new { ReadOnly = "true" })</td>
</tr>
<tr>
<td>Unit</td>
<td>@Html.TextBoxFor(m => m.Materials_Group.Unit, new { ReadOnly = "true" })</td>
</tr>
<tr><td colspan="2"><hr /></td></tr>
<tr>
<td colspan="2" align="center">
<table>
<tr>
<td class="text-info" width="30%">Client Part Num</td>
<td colspan="2">@Html.EditorFor(m => m.ClientPartNum)</td>
</tr>
<tr>
<td class="text-info">Additional Info</td>
<td colspan="2">@Html.TextAreaFor(m => m.AdditionalInfo, new { TextMode = "MultiLine", Rows = "3", Cols = "500" })</td>
</tr>
<tr><td colspan="2" align="center"><h5 class="text-info">Properties</h5></td></tr>
<tr>
<td class="text-info">Outer Diameter</td>
<td>@Html.DisplayFor(m=>m.OuterDiameter, new { style="width:100px;id:tbOD"})</td>
<td>@(Html.Kendo().DropDownListFor(m => m.OuterDiameter)
.Name("OuterDiameter")
.DataValueField("Text")
.DataTextField("Value")
.DataSource(ds =>
{
ds.Read(read =>
{
read.Action("GetPipeOD", "Materials", new { od = m.OuterDiameter }); <<<<<< Here is where the model value needs to be sent >>>>>>>
});
})
.HtmlAttributes(new { style="width:100px"})
//.Events(e =>
//{
// e.Change("onChange").Select("onSelect");
//})
)
</td>
</tr>
<tr>
<td class="text-info">Wall Thickness</td>
<td colspan="2"></td>
</tr>
<tr>
<td class="text-info">Specification</td>
<td></td>
</tr>
<tr>
<td class="text-info">Grade</td>
<td colspan="2"></td>
</tr>
<tr>
<td class="text-info">Seam Type</td>
<td colspan="2"></td>
</tr>
<tr>
<td class="text-info">Coating 1</td>
<td colspan="2"></td>
</tr>
<tr>
<td class="text-info">Coating 2</td>
<td colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
