Hi;
It's possible to set a Shared DataSource lto a Fluent API Scheduler, like to a Grid, via DataSource Name?
Example:
DataSource:
@(Html.Kendo().DataSource<Models.Event>() .Name("SharedEvents") .SignalR(sr => sr .Transport(tr => tr .Promise("hubStart") .Hub("OpsToolHub") .Client(c => c .Read("read") .Create("create") .Update("update") .Destroy("destroy")) .Server(s => s .Read("read") .Create("create") .Update("update") .Destroy("destroy"))) .Schema(schema => schema .Model(model => { model.Id(m => m.id); model.Field(m => m.fID).Editable(false); model.Field("start", typeof (DateTime)).From("Start"); model.Field("end", typeof (DateTime)).From("End"); model.Field("title", typeof (string)).From("Title"); model.Field("description", typeof (string)).From("Description").Editable(true); model.Field("recurrenceRule", typeof (string)).From("RecurrenceRule"); model.Field("recurrenceException", typeof (string)).From("RecurrenceException"); model.Field("isAllDay", typeof (bool)).From("IsAllDay").Editable(true); model.Field("startTimezone", typeof (string)).From("StartTimezone").Editable(true); model.Field("endTimezone", typeof (string)).From("EndTimezone").Editable(true); }) ) ))
Scheduler:
01.@(Html.Kendo().Scheduler<Models.Event>()02. .Name("schedulerWeek")03. .Date(DateTime.Now)04. .StartTime(new DateTime(2017, 1, 1, 1, 00, 00))05. .Height(1000)06. .AllDaySlot(false)07. .Timezone("Etc/UTC")08. .MajorTick(1440) 09. .MinorTickCount(1) 10. .CurrentTimeMarker(marker =>11. {12. marker.UpdateInterval(600000); //updates each 10min.13. marker.UseLocalTimezone(false);14. })15. .Views(views =>16. { 17. views.CustomView("kendo.ui.SchedulerTimelineWeekView", t =>18. { t.Title("schedulerWeek"); 19. }); 20. })21. .Resources(resource =>22. {23. resource.Add(m => m.type)24. (...) //shorttened25. .Group(group => group.Resources("RegisterName", "type").Orientation(SchedulerGroupOrientation.Vertical))26. .EventTemplateId("event-template")27. .DataSource(????) '???? how to set the shared datasource, imposible via name as far as we try!!!
Waiting for response;
Best Regards;

@(Html.Kendo().Grid<intranet.mvc5b.Models.Arrangement.Lokaler>()
.Name("gridLokaler")
.Columns(col =>
{
col.Bound(p => p.ID).Hidden(true);
col.Bound(p => p.Lokale);
col.Bound(p => p.Aktiv).Width(60).ClientTemplate("#=Aktiv? 'Ja' : 'Nej' #");
col.Command(command => { command.Edit()
.Text("Ret")
.UpdateText("Gem")
.CancelText("Afbryd");
}).Width(90);
})
.ToolBar(toolbar => toolbar.Create().Text("Opret lokale"))
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("arrLokaleEdit"))
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(15)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ID))
.Update("Lokaler_Update", "Arrangement")
.Create("Lokale_Opret", "Arrangement")
.Read("Lokale_Read", "Arrangement")
)
.Deferred()
)
This grid shows ok, but when I edit a row and save without making any changes
it calls the create action insted of update
Im using 2017.1.223.545
Hi,
Is it possible to have custom command button in TreeList?
I have tried to configure custom command button in Html.Kendo().TreeList as following:
@(Html.Kendo().TreeList<ABM.Models.AzureTreeViewData>()
.Name("ddlSubs")
.Columns(columns =>
{
columns.Add().Field(e => e.Name).Width(480).TemplateId("node-template");
columns.Add().Field(e => e.Type).Hidden(true);
columns.Add().Field(e => e.SubID).Hidden(true);
columns.Add().Command(command =>
{
command.Custom().Text(" ").Name("buttonCustom").Click("showDetails").ImageClass("fa fa-eye fa-lg");
});
})
.Filterable()
.Sortable()
.Selectable(true)
.DataSource(dataSource => dataSource
.Read(read => read.Action("TreeData", "Main").Data("subsdata"))
.ServerOperation(true)
.Model(m =>
{
m.Id(f => f.Id);
m.ParentId(f => f.ParentId);
m.Expanded(true);
m.Field(f => f.Name);
m.Field(f => f.Icon);
m.Field(f => f.Type);
m.Field(f => f.SubID);
})
)
.Height(540)
)
<script>
function showDetails(e) {
e.preventDefault();
var dataItem = $("#ddlSubs").dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#Details").data("kendoWindow");
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
</script>
Unfortunately Click event never hit in my code.
Could you please help me.
Thank you.
Hi,
the Scenario goes as follows - user fills out a form and submits it. The data from the form is merged with a word document template. I want to show the user the completed document.
here is code snippet -> return new Result { CoverSheet = memoryStream.ToArray() };
I'm stuck on how to view the document here is my razorview:
I'm stuck on how to render the coversheet. I have tried TelerikReporting and am currently looking at @(Html.Kendo().Editor()...
I see examples for how to use Import to open a word document but now how to create a view with existing data. Any help with how to proceed would be appreciated.

Hi!
Is there a way to set the BaseUnit to Milliseconds.
I have to view a sine curve with max. 5Hz like this:
var oscillatorChartData = new kendo.data.ObservableArray(
Hi All,
How we add dropdownlist as filter in kendo grid and how its populate from enum? Below i providing my code
@(Html.Kendo()
.Grid<Portals.Areas.Reports.Models.TransactionReportItem>()
.Name("transactionGrid")
.HtmlAttributes(new { @class = "grid-primary" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(100)
.Read(read => read.Action("GetTransactions", "Transactions")))
.Pageable(pageable => pageable
.Enabled(true)
.PageSizes(new[] { 100, 500 })
.Refresh(false)
.ButtonCount(5))
.Columns(columns =>
{
columns.Bound(row => row.TransactionID);
//Order ID Column
columns.Bound(row => row.OrderID);
//TxnAmount Column
columns.Bound(row => row.TransactionAmount).Format("{0:n2}").HeaderHtmlAttributes(new { @class = "text-align-reverse" }).HtmlAttributes(new { @class = "text-align-reverse" });
//Txn date column
columns.Bound(row => row.TransactionDate).Format("{0:" + userPreference.PreferredDateDisplayFormat + "}").HeaderHtmlAttributes(new { @class = "text-align-reverse" }).HtmlAttributes(new { @class = "text-align-reverse" });
//ViewDetail column
columns.Bound(row => row.TransactionID).Title("").Filterable(f => f.Enabled(false))
.ClientTemplate(@"
<button id='#= TransactionID #' data-btn-viewDetail='#= TransactionID #' class='btn btn-neutral btn-sm'>
View Detail
</button>
");
})
.Sortable()
.Filterable(ftb => ftb.Enabled(true))
.ToolBar(tools => tools.Pdf())
.ToolBar(tools => tools.Excel())
.Pdf(pdf => pdf
.AllPages()
.PaperSize("A4")
.Scale(0.8)
.RepeatHeaders()
.AvoidLinks()
.Landscape()
.Title("Title")
.TemplateId("page-template")
.Margin("2cm", "1cm", "1cm", "1cm")
.FileName(string.Format("PayCommerce_Merchant_Transaction_Report_{0}.pdf", DateTime.UtcNow.ToString("yyyymmdd_hhmmss")))
.ForceProxy(true)
.ProxyURL(Url.Action("Pdf_Export_Save", "Transactions"))
)
.Excel(excel => excel
.AllPages(true)
.FileName(string.Format("PayCommerce_Merchant_Transaction_Report_{0}.xlsx", DateTime.UtcNow.ToString("yyyymmdd_hhmmss")))
.ForceProxy(true)
.ProxyURL(Url.Action("Pdf_Export_Save", "Transactions"))
)
)
I'm trying to extend TimelineView so that some events overlap and others are bumped to the next line depending on their status. I can overwrite the _arrangeRows method but can't get the collidingEvents to overwrite. How do I overwrite collidingEvents from the TimelineView?
<script type="text/javascript">
var customTimelineView = kendo.ui.TimelineView.extend({
options: {
name: "customTimelineView",
title: "Custom Time Line",
columnWidth: 30,
},
name: "customTimelineView",
_arrangeRows: function (eventObject, slotRange, eventGroup) {
var test = "test";
var startIndex = slotRange.start.index;
var endIndex = slotRange.end.index;
var rect = eventObject.slotRange.innerRect(eventObject.start, eventObject.end, false);
var rectRight = rect.right + this.options.eventMinWidth;
//var events = kendo.ui.SchedulerView.collidingEvents(slotRange.events(), rect.left, rectRight);
var events = collidingEvents(slotRange.events(), rect.left, rectRight);
slotRange.addEvent({
slotIndex: startIndex,
start: startIndex,
end: endIndex,
rectLeft: rect.left,
rectRight: rectRight,
element: eventObject.element,
uid: eventObject.uid
});
events.push({
start: startIndex,
end: endIndex,
uid: eventObject.uid
});
var rows = kendo.ui.SchedulerView.createRows(events);
if (eventGroup.maxRowCount < rows.length) {
eventGroup.maxRowCount = rows.length;
}
for (var idx = 0, length = rows.length; idx < length; idx++) {
var rowEvents = rows[idx].events;
for (var j = 0, eventLength = rowEvents.length; j < eventLength; j++) {
eventGroup.events[rowEvents[j].uid].rowIndex = idx;
}
}
},
});
function collidingEvents(elements, left, right) {
var idx, startPosition, overlaps, endPosition;
for (idx = elements.length - 1; idx >= 0; idx--) {
startPosition = elements[idx].rectLeft;
endPosition = elements[idx].rectRight;
overlaps = startPosition <= left && endPosition >= left;
if (overlaps || startPosition >= left && endPosition <= right || left <= startPosition && right >= startPosition) {
if (startPosition < left) {
left = startPosition;
}
if (endPosition > right) {
right = endPosition;
}
}
}
return kendo.ui.SchedulerView.eventsForSlot(elements, left, right);
}
</script>
Also, why are some of the functions prefixed with "_"? ie What is difference between "render()" and "_render()"?

Hi,
I'm having trouble to populate a Kendo DropdownBox based upon an change event of a datapicker. I see that everything is working fine, even the json that is parsed after the Ajax call (while iterating through the result) is valid by checking it using alerts (see code below). For some reason the values in my dropdownbox are "Undefined" and i don't know how to resolve this. Can someone help me out with this?
I also tried to use the setDataSource as i read here in this forum, but my dropdownbox doesn't do anything (it's not showing any data at all).
Thanks in advance.
Best Regards,
Hans Oosterhuis
The definition of the DropDownBox:
<p>@(Html.Kendo().DropDownList() .Name("AvailableTimes") .DataTextField("Text") .DataValueField("Value") )
The Ajax call to populate the dropdownbox above:
function RefreshStartTimes() { var employeeId = parseInt($('#Appointment_EmployeeId').val()); var worktypeId = parseInt($("#Appointment_WorkTypeId").val()); var plannedDate = parseDate($("#Appointment_AfspraakVan").val()); var filtermodel = {}; filtermodel = { EmployeeId: employeeId, WorkTypeId: worktypeId, PlannedDate: plannedDate }; var filter = JSON.stringify(filtermodel); $.ajax({ url: '@Url.Action("GetAvailabeTimeSlots", "Appointment", new { area = string.Empty })', type: "POST", data: filter, dataType: 'json', contentType: 'application/json; charset=utf-8', success: function (listItems) { if (JSON.stringify(listItems) != "[]") { //var ddl = $('#AvailableTimes').data("kendoDropDownList"); //ddl.setDataSource(listItems); //ddl.refresh(); $.each(listItems, function (i, listItem) { $("#AvailableTimes").data("kendoDropDownList") .dataSource.add({ "text": listItem.Text, "value": listItem.Value }); alert('Listitem is' + listItem.Text); alert('Value is' + listItem.Value); alert('Selected is' + listItem.Selected); }) //$.each(listItems, function () { // $.each(this, function (k, v) { // /// do stuff // $("#AvailableTimes").data("kendoDropDownList") // .dataSource.add({ "text": k, "value": v }); // }); //}); //$("#AvailableTimes").data("kendoDropDownList").refresh(); //$('#divSearchPNResults').show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("ERROR RefreshCustomerDetail:" + errorThrown); } });
The Ajax call itself:
public JsonResult GetAvailabeTimeSlots(AppointmentFilter filter) { if (filter != null) { var listItems = _appointmentService.GetSuitableTimesForPlannedDate(filter.WorkTypeId, filter.EmployeeId, filter.PlannedDate) .Select(s => new SelectListItem { Value = s, Text = s }) .ToList<SelectListItem>(); return Json(listItems, JsonRequestBehavior.AllowGet); } return Json(null, JsonRequestBehavior.AllowGet); }
