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?
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?