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); }

Hello Team,
When I select 12px in Html Editor it is being set as "9" in Word Document.
Similarly
13 px in Editor is being set as "10"
14px as "10.5"
15px as "11.5"
Is there any option that I can set "14.5px" in editor so that will be "11" in word document ?
Please find the attached word document for reference.
Also I need to add "Calibri" in Font-Names drop down.
Can you please help me with this issue ASAP ? Thanks in advance.

When exporting the data from the Grid to PDF, the grid causes the UI to be distorted. Grid tries to recreate the grid and a progress bar is shown in the UI. Once pdf is generated, the grid comes back to normal before the browser save/cancel dialog is displayed.
So what is causes this flickering and how can i change (hide) this progress bar behavior.
The Grid uses the server side side binding. So the data is already available at the browser.

Hi all
I have built a grid which uses ClientDetailTemplateId to display details per order row.
I am also using the RTL style to display the grid aligned to RTL languages.
Yet the icon to open the details for each row is still displayed to the LTR direction.
Any idea how to fix this?
Here is a working (or not working) sample code
Thanks
<div class="k-rtl"> <div class="container-fluid"> <div class="row"> <div class="col-xs-18 col-md-12"> <script type="text/x-kendo-template" id="rowTemplate"> <div class="orderRow"> <tr> <td> #:OrderID# </td> <td> #:Freight# </td> <td> #:OrderDate# </td> <td> #:ShipName# </td> <td> #:ShipCity# </td> </tr> </div> </script> <script> var rowTemplate = kendo.template($('#rowTemplate').html()); </script> @(Html.Kendo().Grid<APDashboard.Models.OrderViewModel>() .Name("grid") .Columns(columns => { columns.Bound(p => p.Freight).Title("מספר ספינה"); columns.Bound(p => p.OrderDate).Title("תאריך הזמנה").Format("{0:MM/dd/yyyy}"); columns.Bound(p => p.ShipName).Title("שם משלוח"); columns.Bound(p => p.ShipCity).Title("עיר משלוח"); }) .Pageable() .Sortable() .Scrollable() .Filterable() .ClientDetailTemplateId("template") .HtmlAttributes(new { style = "height:550px;" }) .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Read(read => read.Action("Orders_Read", "Grid")) ) .Events(events => events.DataBound("dataBound")) ) @(Html.Kendo().ContextMenu() .Name("menu") .Target("#grid") .Filter(".orderRow") .Orientation(ContextMenuOrientation.Horizontal) .Items(items => { items.Add() .Text("Forward"); }) ) </div> </div> <script id="template" type="text/kendo-tmpl"> @(Html.Kendo().Grid<APDashboard.Models.OrderViewModel>() .Name("grid_#=OrderID#") .Columns(columns => { columns.Bound(o => o.OrderID).Title("מספר הזמנה").Width(110); columns.Bound(o => o.ShipCountry).Title("ארץ משלוח").Width(110); columns.Bound(o => o.ShipAddress).Title("כתובת משלוח").ClientTemplate("\\#= ShipAddress \\#").Width(110); columns.Bound(o => o.ShipName).Title("שם משלוח").Width(300); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(10) .Read(read => read.Action("Orders_Read", "Grid", new { employeeID = "#=OrderID#" })) ) .Pageable() .Sortable() .ToClientTemplate() ) </script> <script> function dataBound() { this.expandRow(this.tbody.find("tr.k-master-row").first()); } </script> </div></div>
Hi all
I search in the forums and could not find that one thing that I am missing.
I have a simple grid implementation from your examples which I wanted to
add a context menu on it but it just does not do the job (I get the regular browser context menu).
here is my code (ASP.NET MVC)
<div class="container-fluid"> <div class="row"> <div class="col-xs-18 col-md-12"> <script type="text/x-kendo-template" id="rowTemplate"> <div class="orderRow"> <tr> <td> #:OrderID# </td> <td> #:Freight# </td> <td> #:OrderDate# </td> <td> #:ShipName# </td> <td> #:ShipCity# </td> </tr> </div> </script> <script> var rowTemplate = kendo.template($('#rowTemplate').html()); </script> @(Html.Kendo().Grid<APDashboard.Models.OrderViewModel>() .Name("AgilePointDashboardGrid") .Columns(columns => { columns.Bound(p => p.OrderID).Filterable(false); columns.Bound(p => p.Freight); columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}"); columns.Bound(p => p.ShipName); columns.Bound(p => p.ShipCity); }) .ClientRowTemplate("#=rowTemplate(data)#") .Pageable() .Sortable() .Scrollable() .Filterable() .HtmlAttributes(new { style = "height:550px;" }) .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Read(read => read.Action("Orders_Read", "Grid")) ) ) @(Html.Kendo().ContextMenu() .Name("menu") .Target("#AgilePointDashboardGrid") .Filter(".orderRow") .Orientation(ContextMenuOrientation.Horizontal) .Items(items => { items.Add() .Text("Forward"); }) ) </div> </div> <script> $(document).ready(function() { var menu = $("#menu"); var original = menu.clone(true); original.find(".k-state-active").removeClass("k-state-active"); var initMenu = function () { menu = $("#menu").kendoContextMenu({ target: "#AgilePointDashboardGrid", filter: ".orderRow", select: function(e) { // Do something on select } }); }; initMenu(); }); </script></div>
I would love to know what am I missing here
Thanks

I am using two project MVC Controller project and Web api Controller, I am having telerik MVC kendo grid(Client side grid), In the grid I have called web api (Server side), Get and Post is woking fine but PUT and DELETE is getting error. I have done the CORS but still getting error.
Please find the code snippet and error details below.
MVC Controller Code :
@(Html.Kendo().Grid<EditableCity>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(c => c.iCityID).Hidden();
columns.Bound(c => c.sCityDesc).Title("City Description");
columns.Bound(c => c.sCountryCode).Title("Country");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
})
.ToolBar(toolbar => { toolbar.Create(); })
.Editable(ed => ed.Mode(GridEditMode.PopUp))
.Selectable()
.Filterable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.WebApi()
.PageSize(20)
.Model(m => m.Id(p => p.iCityID))
.ServerOperation(false)
.Read(read => read.Url("http://localhost:60018/api/city"))
.Create(create => create.Url("http://localhost:60018/api/city").Type(HttpVerbs.Post))
.Update(Update => Update.Url("http://localhost:60018/api/city/").Type(HttpVerbs.Put))
.Destroy(del => del.Url("http://localhost:60018/api/city/").Type(HttpVerbs.Delete))
)
)
CORS in WebApiConfig - Register
var cors = new EnableCorsAttribute("http://localhost:60018", "*", "*");
config.EnableCors(cors);
Web API controller Code:
//[RoutePrefix("api/catalog")]
public class CityController : ApiController
{
CityBL cityBL = new CityBL();
// GET: api/City
//[Route("city")]
[ResponseType(typeof(IQueryable<EditableCity>))]
[CacheFilter(TimeDuration = 10)]
//[Authorize]
public async Task<DataSourceResult> Get([ModelBinder(typeof(WebApiDataSourceRequestModelBinder))] DataSourceRequest request)
{
var susername = HttpContext.Current.User.Identity.Name;
var gridData = await cityBL.GetCity();
var result = new DataSourceResult()
{
Data = gridData,
Total = gridData.Count()
};
return result;
}
// GET: api/City/5
//[Route("city/{id}")]
[ResponseType(typeof(EditableCity))]
public async Task<IHttpActionResult> Get(int id)
{
var result = await cityBL.GetCityById(id);
return Json(result);
}
// POST: api/City
public async Task<IHttpActionResult> Post(EditableCity value)
{
if (value.iCityID > 0)
await cityBL.UpdateCity(value);
else
await cityBL.InsertCity(value);
return Json(value);
}
//// PUT: api/City/5
//public async Task<IHttpActionResult> Put(EditableCity value)
//{
// await PutCity(value.iCityID, value);
// return Json(value);
//}
// DELETE: api/City/5
[HttpDelete]
public async Task<IHttpActionResult> Delete(int id)
{
await cityBL.DeleteCity(id);
return Ok();
}
}
I am getting error.(PUT and Delete)
OPTIONS http://localhost:60018/api/city/ 400 (Bad Request)
XMLHttpRequest cannot load http://localhost:60018/api/city/. Response for preflight has invalid HTTP status code 400
Uncaught SyntaxError: Unexpected token u in JSON at position 0
at Function.parse [as parseJSON] (<anonymous>)
at init.error_handler (City:76)
at init.trigger (kendo?v=GlJVUnHmCTfOQhn3vJxT3TaOscBWvurIgbVIZ_jm6_41:1)
at init.error (kendo?v=GlJVUnHmCTfOQhn3vJxT3TaOscBWvurIgbVIZ_jm6_41:1)
at Object.error (kendo?v=GlJVUnHmCTfOQhn3vJxT3TaOscBWvurIgbVIZ_jm6_41:1)
at c (Scripts?v=rDiPocDqq4l1v5wzpbjulXqJqaXM1N6IzVYG_owHFO81:1)
at Object.fireWith [as rejectWith] (Scripts?v=rDiPocDqq4l1v5wzpbjulXqJqaXM1N6IzVYG_owHFO81:1)
at b (Scripts?v=rDiPocDqq4l1v5wzpbjulXqJqaXM1N6IzVYG_owHFO81:1)
at XMLHttpRequest.<anonymous> (Scripts?v=rDiPocDqq4l1v5wzpbjulXqJqaXM1N6IzVYG_owHFO81:1)
Thanks
Suman