Hi, in our app, customers can create "custom Fields", and they can have any title they want.
Ideally, we always prefer to keep original values in javascript objects without encoding them, and use templates to encode if needed.
I have this very "limit" case, where the title of a columns is "<script>alert(1)</script>".
https://dojo.telerik.com/@foxontherock/imacAYOR/3
There are 3 cases, one with script, one with bold, both with templating, and the last one, bold without template (all default)
I am able to use a groupTemplate and headerTemplate to display them correctly.
But, I tried several methods to make the "columnMenu" appear correctly, I never found a solution.
I tried the "columnMenuInit", but the "alert" appear before the init event.
What I can do for now is set "menu=false" for these columns...
I don't want to "htmlEncode" the title property itself.
Is it possible to set a custom template on the kendoMenu that is displayed to choose the column, or is it possible to set a setting to let the menu encode the text?
For exemple, I can set a title like <b>mytext</b> and the text will appear as bold in the menu!
I think that you forgot to encode the title when the columnmenu is displayed.
The "encode" parameter correctly encode the value, but doesn't affect the title.
Maybe we should get a encodeTitle attribute?
I think that all of this should work correctly without any custom templates.
<note>
You can't say that you don't support it,
because, you did it correctly in the "drop zone" when grouping,
the title is htmlencoded without any need for custom template!!!
just try it with the "bold no template" column and you'll see.
</note>

var gridDataSource = new kendo.data.DataSource({ data: results, total: results.length, pageSize: 20, schema: { model: { id: "id", fields: { attributes: { type: "object" } } } }});//Build the Kendo UI gridvar kendoDataGrid = $("#dataGrid").kendoGrid({ dataSource: gridDataSource, columns: GetGridColumns(), scrollable: true, pageable: true, resizable: true, sortable: true, selectable: "row", navigatable: true, height: gridHeight, editable: false}).data("kendoGrid");Couldn't find any similar questions on the forum so hopefully someone can help :)
At the moment I have a pre-filter on my grid, which filters a column based on the role of the logged in user.
filter: {
filters: [{ field: "RSM", operator: "contains", value: manager}]
}
This pre-filters the grid when the logged in user is a manager. The issue I'm having is it will always pre-filter the grid even if the logged in user isn't a manager. So although the data itself won't be filtered, it will still appear as if the Manager column is being filtered.
https://ibb.co/FX3c6Qb
So is it possible to only apply the filter if the current user is a manager only? If it's just a regular user then don't apply the filter.
Thanks as always.
@using Kendo.Mvc.UI.Fluent@model PosPayAndBankRec.Models.TreasuryCreateModel@functions { private void AccountGridCommandDef(GridColumnFactory<PosPayAndBankRec.Models.TreasuryCreateItem> columns) { columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160); columns.Bound(p => p.AccountID).Hidden(); columns.Bound(p => p.BankID).Hidden(); columns.Bound(p => p.BankName).Title("Bank").Width(120); columns.Bound(p => p.RamQuestBankNumber).Title("Bank #").Width(60); columns.Bound(p => p.AccountName).Title("Account").Title("Location"); columns.Bound(p => p.AccountNumber).Title("Acct #"); columns.Bound(p => p.PpStatus).Title("Positive Pay"); columns.Bound(p => p.BrStatus).Title("Bank Rec"); //columns.Bound(p => p.AccountFolderName).Title("Folder"); } private void AccountGridDataSource(DataSourceBuilder<PosPayAndBankRec.Models.TreasuryCreateItem> dataSource) { dataSource.Ajax() .Model(AjaxAccountDataSourceBuilder) .Sort(sort => sort.Add(p => p.BankName)) .ServerOperation(true) .Create(create => create.Action("Create", "Home")) .Read(read => read.Action("Read", "Home", new { id = Request.QueryString["id"] })) .Update(update => update.Action("Edit", "Home")) .Destroy(destroy => destroy.Action("Delete", "Home")); //.Events(e => e.Error("error")); } private void AjaxAccountDataSourceBuilder(DataSourceModelDescriptorFactory<PosPayAndBankRec.Models.TreasuryCreateItem> model) { model.Id(p => p.AccountID); model.Field(p => p.AccountName); } private void AccountGridToolBarDef(GridToolBarCommandFactory<PosPayAndBankRec.Models.TreasuryCreateItem> toolbar) { toolbar.Create().Text("Treasury Request"); }}@{ ViewBag.Title = "Treasury Connections"; }@(Html.Kendo().Grid<PosPayAndBankRec.Models.TreasuryCreateItem>() .Name("Treasuries") .Columns(AccountGridCommandDef) .DataSource(AccountGridDataSource) .ToolBar(AccountGridToolBarDef) .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Treasury Request")).TemplateName("TreasuryPopup").AdditionalViewData(new { Banks = Model.Banks })) .Sortable() .Filterable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .ClientDetailTemplateId("ContactDetails") .Pageable(p => p.Enabled(false)) .Scrollable(s => { s.Height(700); s.Virtual(true); }) )</script> <script id="ContactDetails" type="text/kendo-tmpl"> @(Html.Kendo().Grid<PosPayAndBankRec.Models.ContactDetailsModel>() .Name("Details_#=BankID#") .Columns(columns => { columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160); columns.Bound(p => p.ContactName).Width(150); columns.Bound(p => p.ContactType).Width(100); //columns.Bound(p => p.ContactEmail).Width(150); columns.Bound(p => p.ContactPhone).Width(100); columns.Bound(p => p.Description).Width(100); //columns.Bound(p => p.ContactNotes).Width(200); }) .ToolBar(p => p.Create()) .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.BankID)) .Sort(sort => sort.Add(p => p.ContactName)) .ServerOperation(true) .Create(create => create.Action("Create", "Contact")) .Read(read => read.Action("Details", "Contact", new { id = "#=BankID#" })) .Update(update => update.Action("Update", "Contact")) .Destroy(destroy => destroy.Action("Delete", "Contact")) ) .Pageable() .Sortable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Contact")).TemplateName("ContactPopup").AdditionalViewData(new { Banks = Model.Banks })) .ToClientTemplate()) .ToClientTemplate())</script>@using System.Collections@using PosPayAndBankRec.Models@model PosPayAndBankRec.Models.TreasuryCreateItem@{ ViewBag.Title = "Treasury";}<fieldset> <legend>Bank Account Info</legend><table id="table"> <tr> <th> Bank </th> <td> @(Html.Kendo().DropDownListFor(model => model.BankID) .Name("BankID") .OptionLabel("-- Select Item --") .DataTextField("BankName") .DataValueField("BankID") .DataSource(source => { source.Read(read => { read.Action("GetCascadeBanks", "Home"); }); }) ) </td> </tr> <tr> <th> Location </th> <td colspan="2"> <script type="text/javascript">// function ShowHide(chk,txt) // {// if ((document.getElementById(chk).checked))// document.getElementById(txt).style.display=''; // else // document.getElementById(txt).style.display='none';// } $(document).ready(function () { $("#AccountID").trigger("valueChange"); }); </script> @(Html.Kendo().DropDownListFor(model => model.AccountID) .Name("AccountID") .OptionLabel("-- Select Item --") .DataTextField("AccountName") .DataValueField("AccountID") .DataSource(source => { source.Read(read => { read.Action("GetCascadeAccounts", "Home") .Data("getBankID"); }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom("BankID") .Events(events => events.Change("onBankChange") ) ) </td> </tr> <tr> <td> </td> <th> Active </th> <th> Deactive </th> </tr> <tr> <th> Bank Reconcilliation </th> <td> @Html.EditorFor(model => model.BrActivationDate) </td> <td> @Html.EditorFor(model => model.BrDeactivationDate) </td> </tr> <tr> <th> Positive Pay </th> <td> @Html.EditorFor(model => model.PpActivationDate) </td> <td> @Html.EditorFor(model => model.PpDeactivationDate) </td> </tr></table></fieldset><fieldset> <legend>Contacts</legend>@(Html.Kendo().Grid<PosPayAndBankRec.Models.ContactDetailsModel>().Name("Contacts") .Columns(columns => { columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160); columns.Bound(p => p.ContactName).Width(150); columns.Bound(p => p.ContactType).Width(100); //columns.Bound(p => p.ContactEmail).Width(150); columns.Bound(p => p.ContactPhone).Width(100); //columns.Bound(p => p.Description).Width(100); //columns.Bound(p => p.ContactNotes).Width(200); }) .ToolBar(p => p.Create()) .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.BankID)) .Sort(sort => sort.Add(p => p.ContactName)) .ServerOperation(true) .Create(create => create.Action("Create", "Contact")) .Read(read => read.Action("GetCascadeContacts", "Home") .Data("getBankID")) .Update(update => update.Action("Edit", "Contact")) .Destroy(destroy => destroy.Action("Delete", "Contact")) ) //.AutoBind(false) .Pageable() .Sortable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Contact")).TemplateName("ContactPopup")))</fieldset>public ActionResult GetCascadeContacts([DataSourceRequest] DataSourceRequest request, int BankID) { var ortcontacts = from contact in db.ORTContacts join bank in db.ORTBanks on contact.BankID equals bank.BankID where contact.BankID == BankID orderby contact.ContactName select new TreasuryCreateItem() { ContactID = contact.ContactID, ContactName = contact.ContactName, ContactEmail = contact.ContactEmail, ContactPhone = contact.ContactPhone, ContactType = contact.ContactType, ContactNotes = contact.ContactNotes, BankID = contact.BankID, BankName = bank.BankName }; return Json(ortcontacts.ToDataSourceResult(request)); }using System;using System.Collections.Generic;using System.Linq;using System.Web;using PosPayAndBankRec.Domain.Models;using System.ComponentModel.DataAnnotations;using PosPayAndBankRec.Models.Validators;namespace PosPayAndBankRec.Models{ public class TreasuryCreateItem { public int AccountID { get; set; } public int BankID { get; set; } public string BankName { get; set; } [Required] [UniqueAccountName("This bank is already named in the system.")] [DataType(DataType.Text)] public string BankAccountName { get; set; } [Required] [UniqueAccountName("This account is already named in the system.")] [DataType(DataType.Text)] public string AccountName { get; set; } public string AccountNumber { get; set; } public string RamQuestBankNumber { get; set; } public string ContactType { get; set; } public string Description { get; set; } public int ContactID { get; set; } public string ContactName { get; set; } public string ContactPhone { get; set; } public string ContactEmail { get; set; } public string ContactNotes { get; set; } public bool? HasPosPay { get; set; } public bool? HasBankRec { get; set; } public string BrStatus { get; set; } public string PpStatus { get; set; } public string BrStatusNotes { get; set; } public string PpStatusNotes { get; set; } public Nullable<System.DateTime> BrActivationDate { get; set; } public Nullable<System.DateTime> BrDeactivationDate { get; set; } public Nullable<System.DateTime> PpActivationDate { get; set; } public Nullable<System.DateTime> PpDeactivationDate { get; set; } public List<ORTBank> Banks { get; set; } } public class TreasuryCreateModel { public List<ORTBank> Banks { get; set; } public List<ORTAccount> Accounts { get; set; } public List<ORTContact> Contacts { get; set; } public IEnumerable<TreasuryCreateItem> TreasuryCreateItems { get; set; } }}<script type="text/javascript"> function onBankChange(e) { var BankID; var bankDropdown = this; var contactGrid = $("#Contacts").data("kendoGrid"); // Set BankId to the selected id of the bankDropDown BankID = $.map(this.select(), function (item) { var dataItem = bankDropdown.dataItem(bankDropdown.select()).Id; }); // Read the datasource again contactGrid.dataSource.read(); } function getBankID() { return { BankID: $("#BankID").val() }; } function setPopupDimensions(ev) { window.setTimeout(function () { $(".k-edit-form-container").parent().width(800).height(400).data("kendoWindow").center(); }, 100); } </script>Is there an example of how to render a bar code widget in a pdf export header using a kendo template? I'm using MVC/Razor.
This does not work
<script type="x/kendo-template" id="page-template">
<div class="pdf-page-template">
<div class="header">
<h1>My Order</h1>
<div>@(Html.Kendo().Barcode().Name("gudbrands").Value(Model.OrderNumber).Encoding(BarcodeSymbology.Code39).Width(280).Height(100))</div>
<div><strong>Order Number</strong> @Model.Header.OrderNumber
</div>
</div>
</script>

Hello,
Our app displays many numbers and we often use the kendo.toString function according to https://docs.telerik.com/kendo-ui/globalization/intl/numberformatting
In some places we use it with the format ##,# (to display integers) and in others we use ##,#.00 to always print the decimal part.
Here are two examples:
kendo.toString(12345.10, "##,#”) >>”12,345"
kendo.toString(12345.10, "##,#.00”) >> "12,345.10"
In certain area we wish to be able and present integers as integers, and without the decimal part, and present floats with two decimal parts.
Clearly we cannot use any of the suggested format. Using ##,# only gives integers and ##,#.00 will turn 10 into 10.00 while we wish to keep it as 10
We also cannot use ##,#.## because we cannot allow only 1 decimal digit. The result of kendo.toString(10.1, "##,#.##”) is “10.1” but we must have it as “10.10” because we need either 0 decimal figures or 2.
Is there a format that can answer this need?
Thanks,
Ron.
Good Afternoon,
I've run into a bit of a strange issue and I'm not entirely sure what the cause could be.
We want to use the Kendo Chat widget to power our in-app messaging service, but I've run into an issue that is causing me a bit of stress with the implementation.
When rendering messages, it does not correctly fill the chat area, causing the messages to be rather squished and the datestamps to be rendered partially outside of the container. If I input a long message, this area will grow, but it will grow to the point where the avatar image is pushed out of the right side of the chat area, and the timestamp remains hidden to the left. I have attached images of both of these behaviors.
This chat widget is being rendered inside of a KendoUI window and I have updated to the newest NPM release, if that makes any difference.
We are using Aurelia w/ Typescript, but as this has not yet been added to the Aurelia-KendoUI bridge, the chat widget is being initialized programatically with JQuery. Any insight as to why this is behaving this way would be appreciated.
The window initialization is as follows:
<div id.bind="'chatWindow' + cUser.Thread.ThreadID" ak-window="k-width: 300px; k-height:400px; k-title: Messenger; k-resizable.bind: false; k-visible.bind: false; k-actions.bind: actions; k-widget.bind: chatWindows[cUser.Thread.ThreadID]" k-on-close.delegate="onClose()"> <chat-window chat-thread.bind="cUser.Thread"></chat-window></div>openChat(threadID){ this.chatWindows[threadID].center().open();}
And the chat widget initialization is:
<div id.bind="'chat' + ChatThread.ThreadID" style="height:100%;width:100%"></div>private createChat() { if (!App.myUser) { setTimeout(() => this.createChat(),500); return; } let companyUserID = App.myUser.CompanyUsers[0].CompanyUserID; let user = this.getUserByUserID(App.myUser.UserID); let chat = $("#chat" + this.ChatThread.ThreadID).kendoChat({ // Each instance of the app will generate a unique username. // In this way, the SignalR Hub "knows" who is the user that sends the message // and who are the clients that have to receive that message. user: { name: user!= null ? user.Contact.FirstName + " " + user.Contact.LastName : null, iconUrl:user!= null ? user.AvatarURL : null }, // This will notify the SignallR Hub that the current client is typing. // The Hub, in turn, will notify all the other clients // that the user has started typing. typingStart: function () { //chatHub.invoke("sendTyping", chat.getUser()); }, // The post handler will send the user data and the typed text to the SignalR Hub. // The Hub will then forward that info to the other clients. post: function (args) { //chatHub.invoke("send", chat.getUser(), args.text); } }).data("kendoChat"); for (let message of this.ChatThread.Messages) { if(message.CreatedByUserID == App.myUser.UserID) { let myUser = chat.getUser(); chat.renderMessage({type:'text',text:message.Message,timestamp:message.Timestamp},myUser); continue; } let user = this.getUserByUserID(message.CreatedByUserID); chat.renderMessage({type:'text',text:message.Message,timestamp:message.Timestamp},{ id: user.UserID, name: user != null ? (user.Contact.FirstName + " " + user.Contact.LastName) : null, iconUrl: user != null ? user.AvatarURL: null}); } }I have several events on the same day (allday), and I have a requirement to move all events from one day to another.
I know that today it is possible to hold the CTRL key and select one by one, but I would like to know if there is any feature to select all from the same day.
Or if it does not exist, I can put a button below the day for the user click, and i do this programmatically.
Thank you.
As it stands, the menu filter dropdown Null checkbox doesn't return any of the grids Null values. Is there a way to correct the filters operator or to even remove the checkbox option to filter by Null?
https://i.ibb.co/9qr5Vwr/2.png
I've had a look through the forum and couldn't find an official response to deal with this issue, there was this thread but I've not stumbled across these filter options before and I'm not interested in updating base code as we reference the most recent kendo from your repos. https://www.telerik.com/forums/multi-filter-with-null-values---they-are-not-visible
Thanks in advance.