Bug report
The issue is reproducible when the DatePicker with DateInput is used as an editor in Kendo Grid for ASP.NET MVC with "InCell" edit mode.
When a value which is less than the Min value or more than the Max value is typed in, the DatePicker is left blank rather than applying the Min/Max value.
Reproduction of the problem
1. Create a grid and set the "InCell" edit mode.
2. Create a DatePickerFor() editor and enable the DateInput(true) property.
3. Input value which is before 1/1/1900 or after 12/31/2099. E.g 1/1/1111
4. Value is left blank instead of the Min value being applied. (Same goes for Max value)
Current behavior
When value before 1/1/1900 or after 12/31/2099 is typed in, the cell is left blank instead of the Min/Max value being applied.
Expected/desired behavior
Apply Min/Max value to the model, instead of null.
Environment
Kendo UI version: 2019.1.220
jQuery version 1.12.4
Browser: [all]
1. Create a solution with several Telerik UI for MVC projects
2. Perform a rename of a value that is present in multiple projects
Expected result: Rename is performed successfully.
Actual result: Visual Studio crashes.
Application: devenv.exe
Hi there,
We've just hit a strange issue. We have a DropDownList called "Title" that displays "Mr", "Mrs", "Ms" etc. However, we sometimes noticed that the Title submitted to the form was "LoanBorrower". This was strange as the only place "LoanBorrower" existed was in the MVC back end of the page with "ViewBag.Title = "LoanBorrower".
It appears that if the ViewBag has an entry with the same name as a Kendo form element, the elements default value is being set as the value in the ViewBag.
I have tried this with ViewBag entries other than Title, and the result is the same.
At the top of my "Borrower.cshtml" page I have the following:
@{
ViewBag.Title = "LoanBorrower";
}
I stripped the DropDownList down to the bare minimum and still had the problem:
@Html.Kendo().DropDownListFor(m => m.Title)
The control rendered as the following. Note the value is set to "LoanBorrower" which is the value in ViewBag.Title:
<input data-val="true" data-val-length="Title must be between 1 and 20 characters" data-val-length-max="20" data-val-length-min="1" data-val-required="Select a title." id="Title" name="Title" type="text" value="LoanBorrower" />
<script>
kendo.syncReady(function(){jQuery("#Title").kendoDropDownList({});});
</script>
I then changed the Kendo control to a Kendo TextBox and had the same problem:
@Html.Kendo().TextBoxFor(m => m.Title)
The control rendered as the following. Again, the value is set to "LoanBorrower":
<input data-val="true" data-val-length="Title must be between 1 and 20 characters" data-val-length-max="20" data-val-length-min="1" data-val-required="Select a title." id="Title" name="Title" value="LoanBorrower" />
<script>
kendo.syncReady(function(){jQuery("#Title").kendoTextBox({});});
</script>
I then changed the control to a standard HTML Textbox and no longer had the issue.
@Html.TextBoxFor(m => m.Title)
The control rendered as the following. Note that this time, the value is an empty string which is correct.
<input data-val="true" data-val-length="Title must be between 1 and 20 characters" data-val-length-max="20" data-val-length-min="1" data-val-required="Select a title." id="Title" name="Title" type="text" value="" />
If I specify "SortMode.Mixed" for a Grid's "SortMode" (via the .Sortable fluent method), the sort mode in the JavaScript initializer is set to "multiple" instead. This can even be seen on the MVC Demo page here: https://demos.telerik.com/aspnet-mvc/grid/sorting (the "mixed" demo behaves just like "multiple").
In the Kendo MVC source code for 2022.1.301, the GridSortableSettings.Serialize method appears to use the following logic:
if (SortMode != GridSortMode.SingleColumn)
{
json["mode"] = "multiple";
}