I am using the Razor wrappers for creating a Gantt chart. I have it displaying without issues, and people are happy. However, I also need to convert it into an image to save locally on the server. I see a lot of places where the JQuery works to save it as an image, but is there a way to render it as an image directly from Razor?
@(Html.Kendo().Grid<TMS.Domain.Operations.TIMS.CoreObjects.ContractOrderEvent>() .Name("ContractDetailOrderEventGrid") .Columns(columns => { columns.Command(o => { o.Destroy(); o.Edit(); }).Width(100); columns.Bound(o => o.ContractTypeName).Width(100); columns.Bound(o => o.OrderLevelFlag).Width(50); columns.Command(command => command.Custom("Update").Click("ShowRates")).Width(75); columns.Bound(o => o.InvoiceDescription).Width(100); columns.Bound(o => o.SourceContainerOwner).Width(100); columns.Bound(o => o.DestContainerOwner).Width(100); columns.Bound(o => o.SourceContainerTypeName).Width(100).Title("Src Container Type"); columns.Bound(o => o.DestContainerTypeName).Width(100); }) .Scrollable(scrolling => scrolling.Enabled(true).Height("250px")) .Editable(editable => editable.Mode(GridEditMode.InLine)) .Sortable(sorting => sorting.Enabled(true)) .Pageable(paging => paging.Enabled(false)) .Resizable(resizing => resizing.Columns(true)) .Filterable(filtering => filtering.Enabled(true)) .Groupable(grouping => grouping.Enabled(true)) .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.ContractOrderEventId)) .Read(read => read.Action("ReadContractOrderEvent", "ContractGrid", new { contractId = Model.DetailModel.ContractId } )) .Update(update => update.Action("UpdateContractOrderEvent", "ContractGrid")) .Destroy(update => update.Action("DestroyContractOrderEvent", "ContractGrid")) ) )@(Html.Kendo().Window() .Name("Rates") .Title("Rates") .Visible(false) .Modal(true) .Draggable(true) .Width(500) .Height(500) )<script> function ShowRates(e) { var direction = "ContractRateAdmin/OpenContractRate"; var wnd = $("#Rates").data("kendoWindow"); if (!wnd) { // first click of the button - will automatically fetch the contentUrl wnd = $("#Rates").kendoWindow({ title: "Rates", actions: [ "Close"], content: direction, width: "800px", height: "600px", visible: false, modal: true }).data("kendoWindow"); } wnd.refresh(direction); wnd.center(); wnd.open(); } </script>[HttpGet, ImportModelStateFromTempData, HttpParamAction] public ActionResult OpenContractRate() { ContractAdminRateModel model = new ContractAdminRateModel(); model.EffectiveDate = DateTime.Now; // Return the view return PartialView(Url.Content("~/Views/Admin/Contracts/AdminContractsDetailRates.cshtml"), model); }@model TMS.MVC.TIMS.Models.Admin.Contract.ContractAdminRateModel @{ var htmlWidthDefault = "width: 250px;"; } @using (Html.BeginForm(HttpParamActionAttribute.TIMSActionName, "ContractRateAdmin")) { <table> <tr> <td><span class="FieldLabel">Effective Date:</span></td> <td> @Html.Partial(Url.Content("~/Views/Admin/Contracts/FieldTemplates/ContractDetailRate_EffectiveDate.cshtml")) </td> </table> }

Here we have my combobox:
@(Html.Kendo().ComboBox() .Name("depots") .DataTextField("Text") .DataValueField("Value") .Height(500) .Filter(FilterType.Contains) .Events(ev => { ev.Change("onDepotsChangeEvent"); ev.DataBound("onDepotsDataBoundEvent"); ev.Select("onDepotsSelectEvent"); }) .HighlightFirst(true) .Suggest(true) .Value(SOME INITIAL VALUE) .HtmlAttributes(new { style = "width:550px; max-width:100%;" }) .DataSource(source => source.Custom() .Group(group => group.Add("Group", typeof(string))) .Transport(transport => transport .Read(read => { // Censored ;) }) ) ))As you can see, I am setting an initial value with the ".Value(something something". This means that when the combobox loads, the item on the list corresponding to the value, is selected. It works fine as intended.
The problem is when there is not an item with a value corresponding to the initial set value. If that happens, the initial value is shown in the input field of the combobox. After searching around, this is apparently by design and not an error.
What I want to do is, if an item does not exist in the combobox, with the same value as the initial set value, the first item on the list should be selected.
I have searched and searched for days now, with no solution, so any help would be greatly appreciated.
In case it matters, here are the three event methods:
function onDepotsSelectEvent(e) { if (e.item) { var dataItem = this.dataItem(e.item.index()); $.post("@Url.Action("SetSelectedDepotSession", "PartialView")", { id: dataItem.Value }); }}function onDepotsChangeEvent(e){ if (this.value() && this.selectedIndex === -1) { this._filterSource({ value: "", field: this.options.dataTextField, operator: "contains" }); this.select(1); }}function onDepotsDataBoundEvent(e){ var widget = e.sender; if (widget.dataSource.view().length === 0) { widget.text(""); widget.enable(false); }}
I'm trying to use GridEditMode.PopUp to enter times. I currently get the full date in a text box (see pic)
I originally used InLineEditing and was able to use the following:
columns.Bound(c => c.Arrival).Format("{0: HH:mm}").EditorTemplateName("TimeEdit");
This however does not work for PopUp editing. I found out that in order to make the "Name" column not editable in PopUp editing I had to create the following function in the view:
function EditGrid(e) {
if (!e.model.isNew()) {
$('#Name').attr('readonly', 'readonly');
}
}
I am guessing in this function is where I may be able to set the Arrive box to a time picker, but I can't find anything to work.

Hi there
I have a model with a property marked up like this.
[Required][EmailAddress][Display(Name = "Username", ResourceType = typeof(MyResource))]public string Username { get; set; }
The display name of the username property maps to a string "Email".
When i leave the field in the grid blank and update the row, a validation message is shown that correctly says "Email is required."
If i provide an invalid email address and update the row, a validation message is shown that incorrectly says "Username is not valid email"
I have tried applying my own validation message to the Username property with the following modifications to the model.
[Required][EmailAddress(ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(MyResource))][Display(Name = "Username", ResourceType = typeof(MyReouce))]public string Username {get;set;}
Both of the above scenarios produce the same results with the above modifications.
What should the expected behavior be for the email validation message? (e.g use property name or display name attribute)
How do i provide a custom message for the email validation?

Hi,
I hope someone can help me with is. I used the basic usage example (from the demo page) and built upon this to be able to read data from my database and then capture both lists in my controller. List two works as expected, however when re-ordering list one, the list item index remains the same.
View
@(Html.Kendo().ListBox() .Name("RegionOne") .DataValueField("Id") .DataTextField("Name") .DataSource(source => source .Read(read => read.Action("_GetAvailableDashboardItems_ListOne", "Home")) ) .Toolbar(toolbar => { toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right); toolbar.Tools(tools => tools .MoveUp() .MoveDown() .TransferTo() .TransferFrom() .TransferAllTo() .TransferAllFrom() //.Remove() ); }) .Events(events => events .Reorder("test") ) .ConnectWith("RegionTwo") .BindTo(Model.RegionOne) ) @(Html.Kendo().ListBox() .Name("RegionTwo") .DataValueField("Id") .DataTextField("Name") .DataSource(source => source .Read(read => read.Action("_GetAvailableDashboardItems_ListTwo", "Home")) ) .BindTo(Model.RegionTwo) .Selectable(ListBoxSelectable.Multiple) .ConnectWith("RegionOne") )
Controller
public JsonResult _GetAvailableDashboardItems_ListOne() { var items = _userTask.GetAvailableDashboardItems(CurrentUserId, false); return Json(items, JsonRequestBehavior.AllowGet); }public JsonResult _GetAvailableDashboardItems_ListTwo() { var items = _userTask.GetAvailableDashboardItems(CurrentUserId, true); return Json(items, JsonRequestBehavior.AllowGet); }
Task
public IEnumerable<AvailableDashboardItems> GetAvailableDashboardItems(string userId, bool Region) { var userItems = _userRepository.GetUserDashboardItems(userId); if (userItems.Count() != 0) { var items = userItems.Where(x => x.Region == Region).OrderBy(x => x.Position); return Mapper.Map<IEnumerable<UserDashboardItem>, IEnumerable<AvailableDashboardItems>>(items); } else { if (!Region) return Mapper.Map<IEnumerable<DashboardItem>, IEnumerable<AvailableDashboardItems>>(_userRepository.GetAvailableDashboardItems()); } return null; }
Any help would be greatly appreciated, Thanks
Rich

Hello, when using a sortaable list is it possible to ignore more than one type of input? Here is my code:
@(Html.Kendo().Sortable() .For("#Termset") .ConnectWith("#AnotherWindow") .Ignore("input") .PlaceholderHandler("placeholder") .Cursor("url('" + Url.Content("~/content/web/sortable/grabbing.cur") + "'), default"))As you can see I have defined "ignore" to pass over input fields so that the user can still enter data, I have other elements though which I need it to ignore. Can you define multiple elements for the sortable list to ignore?
Thanks
I'm implementing a hierarchical grid. it's all working well except if the parent row's ViewModel doesn't have any child items, it still renders a grid with no rows for the detail template. This is the behavior I would expect, but not the behavior I want. If there are no child items, I want to not render a detail template and also not display the expand icon for that row. Here is a case where the same thing was requested for Kendo for Angular. And below is an excerpt of my view:
01.@(Html.Kendo().Grid<PmtHistAccountPaymentVM>(Model.PaymentHistory)02. .Name(gridName)03. .Columns(columns =>04. {05. columns.Bound(c => c.PaymentDate).Title("Date").Format("{0:d}");06. columns.Bound(c => c.PaymentAmount).Format("{0:C}").Title("Amount");07. })08. .ClientDetailTemplateId(gridID + "-accountTransGridTemplate")09. .NoRecords("No Payments")10. .DataSource(dataSource => dataSource11. .Ajax()12. .Model(model => { model.Id(p => p.ID); })13. .PageSize(15)14. .ServerOperation(true)15. .Read(read => read.Action("PaymentHistory_Read", "CustomerAccounts").Data("function(){ ... }"))16. )17. .Events(e => e.DetailInit("crm.accounts_pmthist.grid_initDetailGrid"))18. .Deferred()19.)20.<script type="text/x-kendo-temp" id="@gridID-accountTransGridTemplate">21. #if(TransactionPayments && TransactionPayments.length > 0){#22. @(Html.Kendo().Grid<PmtHistTransactionPaymentVM>()23. .Name(gridName+"#=ID#")24. .Columns(cols =>25. {26. cols.Bound(p => p.AccountTransactionProductName).Title("Description");27. cols.Bound(p => p.CostPaid).Format("{0:c}");28. cols.Bound(p => p.TaxPaid).Format("{0:c}");29. cols.Bound(p => p.PaymentAmount).Format("{0:c}");30. })31. //.Sortable()32. //.Filterable()33. .AutoBind(false)34. .DataSource(ds => ds.Ajax().ServerOperation(false))35. .ToClientTemplate()36. )37. #}#38.</script>
As you can see, on line 21, I attempted to add a conditional statement. This seems to have eliminated the detail template successfully but the expand icon still shows on the parent row and creates an error in the DetailInit event handler. I decided I'd better ask if I'm on the right track or if something better is available to accomplish this?
Has something changed in the latest version of the grid? I have a column on my grid that is bound to a boolean field. It has a template to display a checkmark icon for true and nothing for false. However, the column is automatically displaying a checkbox and my template is being ignored. I've used the same code in other projects so I'm not sure what I'm missing. The only change is the version of telerik I'm using - 2018.1.22.1.
Any ideas?
Here's my code:
@(Html.Kendo().Grid<QuoteViewModel>()
.Name("QuotesGrid")
.BindTo(Model)
.Resizable(resizable => resizable.Columns(true))
.Columns(columns =>
{
columns.Bound(x => x.Quote.Name).Width(100);
columns.Bound(x => x.Quote.Quote_Name__c).Width(300);
columns.Bound(x => x.Quote.Customer).Width(300);
columns.Bound(x => x.Quote.Project_Scope__c).Title("Project Scope");
columns.Bound(x => x.HasSubsOrRentals).Title("Has Sub or Rentals?").ClientTemplate(
"# if(HasSubsOrRentals) { #" +
"<span class='glyphicon glyphicon-ok text-success'/>" +
"# } else { #" +
"<span />" +
"# } #"
);
}))