
Hi
Is there any way to change the background color of all Mondays of the calendar of a MVC datepicker?


Greetings,
I created my database and in my table exist a column with is auto incremented. However, I can't get to set the ID as hidden as I would normally do in MVC , namely the following.
@Html.HiddenFor(model => model.id)
Is there a way to accommplish this in telerik?

I am using the kendo.ui.MultiSelectwidget in a form with an Ajax.BeginForm wrapper.
The view model:
public class ContextViewModel{ public int Context_PK { get; set; } public string Name { get; set; } public string Description { get; set; } public List<int> OwnerPermissions { get; set; } public List<int> UserPermissions { get; set; }}
Razor View Htmlhelper call:
@(Html.Kendo().MultiSelectFor(m => m.OwnerPermissions).DataTextField("Text").DataValueField("Value").DataSource(source => { source.Read(read => { read.Action("GetAppUsers", "Context"); }); })
AJAX binding action method:
[AllowAnonymous]public JsonResult GetAppUsers(){ int applicationid = GetThisApplicationID(); if (applicationid < 1) throw new Exception("Unable to determine application id"); var adul = GetAllApplicationUsers(applicationid); var list = adul.Where(a => a.IsValidBadge) .Select(u => new { Text = (!String.IsNullOrEmpty(u.AltDisplayName) ? u.AltDisplayName : u.DisplayName) + " (" + u.UsernameShort + ")", Value = u.AirportPersonID }).ToList(); list.Insert(0, new { Text = "Owner Not Set", Value = 0 }); return Json(list, JsonRequestBehavior.AllowGet);}
Target Framework: 4.6.1 ASP.NET MVC: 5.2.6debugging in chrome (Version 69.0.3497.100) but behavior is identical in Edge (Microsoft Edge 42.17134.1.0)
JQuery 1.12.4 (Attempts made with both Kendo included jquery.min.js and full nuget package for jquery)
Issue that is occurring is the deselect operation in the multiselect widget is not removing the entry, either programmatically or through a user event (selecting the 'X') from the model it is bound to. View is generated with view model OwnerPermissions property with one entry.
If an attempt is made to programmatically remove the entry in javascript using the Deselect Event, by calling <kendo.ui.MultiSelect>.value() method with an empty array [] a javascript exception is throw (see below) when the <kendo.ui.MultiSelect>.trigger("change") is called.
function onDeselectOwnerPermissions(e) { var owmerMS = $('#frm-context #OwnerPermissions').data("kendoMultiSelect"); if(!owmerMS) {return;} var dataItem = e.dataItem; if(dataItem.Value && dataItem.Value > 0) { var selectapid = dataItem.Value; var selected = owmerMS.value(); selected = jQuery.grep(selected, function(value) { return value != selectapid; }); owmerMS.value(selected); owmerMS.trigger("change"); } }
Exception thrown when <kendo.ui.MultiSelect>.value() is passed an empty array to clear selected.
kendo.all.js:41785 Uncaught TypeError: l.select(...).done is not a function at init._removeTag (kendo.all.js:41785) at init._tagListClick (kendo.all.js:41795) at HTMLSpanElement.r (jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1) at HTMLUListElement.dispatch (jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1) at HTMLUListElement.a.handle (jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1)_removeTag @ kendo.all.js:41785_tagListClick @ kendo.all.js:41795r @ jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1dispatch @ jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1a.handle @ jquery?v=JL596WEzEYSLK79KRL4It4N63VXpRlW4A824KHlhVLc1:1
This is the Htmlhelper generated markup:
<div class="k-widget k-multiselect k-multiselect-clearable" unselectable="on" title="" style=""> <div class="k-multiselect-wrap k-floatwrap" unselectable="on"> <ul role="listbox" unselectable="on" class="k-reset" id="OwnerPermissions_taglist"> <li class="k-button" unselectable="on"> <span unselectable="on">Stacy (stacyp)</span> <span unselectable="on" aria-label="delete" class="k-select"> <span class="k-icon k-i-close"></span></span> </li> </ul> <input class="k-input" style="width: 25px" accesskey="" autocomplete="off" role="listbox" title="" aria-expanded="false" tabindex="0" aria-describedby="OwnerPermissions_taglist" aria-owns="OwnerPermissions_taglist OwnerPermissions_listbox" aria-disabled="false" aria-busy="false"> <span unselectable="on" class="k-icon k-clear-value k-i-close" title="clear" role="button" tabindex="-1"></span> <span class="k-icon k-i-loading k-hidden"></span> </div><select id="OwnerPermissions" multiple="multiple" name="OwnerPermissions" data-role="multiselect" aria-disabled="false" style="display: none;"> <option value="0">Owner Not Set</option> <option value="15336">Brian (brianc)</option> <option value="62278" selected="">Stacy (stacyp)</option></select><span style="font-family: "Open Sans", sans-serif; font-size: 12px; font-stretch: 100%; font-style: normal; font-weight: 400; letter-spacing: normal; text-transform: none; line-height: 24.8571px; position: absolute; visibility: hidden; top: -3333px; left: -3333px;"></span></div>
<script> kendo.syncReady(function(){jQuery("#OwnerPermissions").kendoMultiSelect({"select":onSelectOwnerPermissions,"dataSource":{"transport":{"read":{"url":"/Context/GetAppUsers","data":function() { return kendo.ui.MultiSelect.requestData(jQuery("#OwnerPermissions")); }},"prefix":""},"serverFiltering":true,"filter":[],"schema":{"errors":"Errors"}},"dataTextField":"Text","dataValueField":"Value","value":[62278]});});</script> Note: The logic of the onSelectOwnerPermissions function the select event is bound to commented out to isolate the issue to it was left out of this post for brevity.

I have an application where jquery validation is used. On a page I have to display some double numbers with formatting. The template used for doubles is the same for all values @Html.Kendo().TextBoxFor(model => model).HtmlAttributes(ViewData).
I have searched and it seems there is no way to format the number, however I see that the TextBoxBuilder has a property called Format. However this does not do anything.
What is the point of the property Format?

I have a simple form:
@Model MyViewModel
<form method="post" action='@Url.Action("Submit")'>
<div class="demo-section k-content">
@Html.TextBoxFor(x => x.SomeRequiredField);
@(Html.Kendo().Upload() .Name("files") .HtmlAttributes(new { aria_label = "files" }) )
<p style="padding-top: 1em; text-align: right"><input type="submit" value="Submit" class="k-button k-primary" /></p>
</div>
</form>
public ActionResult Submit(MyViewModel vm, IEnumerable<HttpPostedFileBase> files){
if(ModelState.Valid) {
... do stuff
} else {
return View(vm);
}
}
If I select a bunch of files in my upload control, and push the Submit button, suppose validation failed and the view is posted back, however my selected files are lost and I have to reselect them.
How do I restore the previously selected files in the file upload control (synchronous mode) when the form fails validation and is posted back?

The grid ignore case sensitive by default. But when i try to export excel by server side, the datas are filtered but without ignoring the case.
Any thing to do ?
@(Html.Kendo().Grid(Model)
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
<a class='k-button k-grid-export' title='Export to XLS'>Export vers Excel</a>
</text>);
})
.Columns(columns =>
{
columns.Bound(prat => prat.FirstName);
columns.Bound(prat => prat.LastName);
}
.ColumnMenu()
.Groupable()
.Excel(excel => excel.FileName("Stat.xlsx").Filterable(true).AllPages(true))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.GUIDReference))
.Read(read => read.Action("DataRead", "BackOffice"))
.ServerOperation(false)
)
$(".k-grid-export").on("click", function (e) {
exportToExcel('XLSX');
});
function exportToExcel(format) {
var grid = $("#grid").data("kendoGrid");
var filteredDataSource = new kendo.data.DataSource({
data: grid.dataSource.data(),
filter: grid.dataSource.filter(),
});
filteredDataSource.read();
var filteredData = filteredDataSource.view();
var exportOption = {
format: format,
title: "Export",
createUrl: "/BackOffice/Export",
downloadUrl: "/BackOffice/Download"
}
data = {
model: JSON.stringify(grid.columns),
data: JSON.stringify(filteredData.toJSON()),
format: exportOption.format,
title: exportOption.title
};
$.post(exportOption.createUrl, data, function () {
window.location.replace(kendo.format("{0}?format={1}&title={2}",
exportOption.downloadUrl,
exportOption.format,
exportOption.title));
});
}
I am trying to implement a DropDownTree on a Grid Editing Popup.
1: I am unable to make the DefaultValue work. I am using an ID Like so: m.Field(p => p.treeID).DefaultValue(3)
2: Selecting another value in the tree does not seem to change the value in the related Grid Cell.

I am a little surprized to see that the dropdowntree selects values with string values rather than with id's.
What if you have the same string value more than once in the tree?
How can I set the value of the dropdowntree with an id?
