### Bug report
The DropDownTree TagHelper with enabled checkboxes does not submit the selected options when it is bound to a Model property.
### Reproduction of the problem
1. Define a DropDownTree TagHelper as a form editor and and enable its checkboxes.
2. Bind the editor to a Model property (an array of integers).
3. Submit the form and examine the submit request payload. The values of the selected items are missing.
//Model
public class TestFormModelClass
{
public int[] MonthsSelectedIds { get; set; }
}
//View
@model TestFormModelClass
<form method="post">
<kendo-dropdowntree for="MonthsSelectedIds"
check-all="true"
datatextfield="Month"
datavaluefield="Id">
<hierarchical-datasource type="DataSourceTagHelperType.Custom">
<schema>
<hierarchical-model id="id"></hierarchical-model>
</schema>
<transport>
<read url="/api/items" />
</transport>
</hierarchical-datasource>
<checkboxes check-children="false" name="CheckedMonths" enabled="true" />
</kendo-dropdowntree>
<button type="submit">Save</button>
</form>
### Expected/desired behavior
When the DropDownTree TagHelper with checkboxes is used as a form editor, the values of the selected items must be submitted as expected to the server.
### Workaround
Use the HtmlHelper version of the DropDownTree
### Environment
* **Telerik UI for ASP.NET Core version: 2024.1.319
* **Browser: [all]
DropDownTreeFor with checkboxes enabled is not binding to model value after postback.
Use the following definition of a DropDownTreeFor HtmlHelper in a plain HTML form, where MySelectedIds is int[]
:
@(Html.Kendo().DropDownTreeFor(m => m.MyClass.MySelectedIds)
.Checkboxes(checkboxes => checkboxes
.CheckChildren(false)
)
.DataTextField("MyText")
.DataValueField("MyId")
.AutoClose(false)
.CheckAll(true)
.DataSource(dataSource => dataSource
.Custom()
.Transport(t => t
.Read(r => r.Url("/api/items"))
)
)
)
The DropDownTree is bound to the model value on page load, but on successful form submission and returning the model the DropDownTree is not bound to the data. Refer to ticket 1648108 for a runnable example.
The DropDownTree should be bound to the model value after successful form submission.
Bind the model to a string[]
instead of int[]
.
When the Columns.Command.Edit.UpdateText property is set to Update
, the text will not be modified and will remain as the default value Save
.
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Command(command => {
command.Edit().UpdateText("Update"); //Will not work
}).Width(250);
})
//....
)
REPL
https://netcorerepl.telerik.com/wIuyvtcO41rAa82G36
The text should change to the specified content within UpdateText.
Set the text via JavaScript using the setOptions method and columns.command.text:
$(document).ready(function(){
var grid = $("#grid").data("kendoGrid");
var options = grid.getOptions();
//set the text for the first command in the last column
// as shown in the second example on:
//https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.command#columnscommandtext
options.columns[4].command[0].text = { edit: "Edit", update: "Update" };
grid.setOptions(options);
});
REPL
https://netcorerepl.telerik.com/wIYeGmOz39LL8mHN26
### Bug report
When adding a new record in an InCell editable Grid with enabled "autoSync" option, it is not rendered in the Grid.
### Reproduction of the problem
A Dojo sample for reproduction: https://dojo.telerik.com/@gdenchev/omotILiP
### Expected/desired behavior
The new record must be visible at the top of the Grid table when the Create operation completes.
The last working version is 2024.1.130.
### Environment
* **Kendo UI version: 2024.1.319
* **jQuery version: 3.7.0
* **Browser: [all]
### Bug report
Adding the [Authorize(Roles = "Admin, User")] attribute at Controller or Actions within the Controller does not show the Menu items.
### Reproduction of the problem
1. Create an application with authorization and add "Admin" and "User" roles.
2. Add the [Authorize(Roles = "Admin, User")] attribute to a specified Action method within the Controller:
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
[Authorize(Roles = "Admin, User")]
public IActionResult Security_Information()
{
return View();
}
}
3. Add a Menu:
@(Html.Kendo().Menu()
.Name("htmlhelperMenu")
.SecurityTrimming(true)
.Items(menu =>
{
menu.Add().Text("Home").Action("Index", "Home");
menu.Add().Text("Security Information").Action("Security_Information", "Home");
})
)
<kendo-menu name="taghelperMenu">
<items>
<menu-item text="View Inventory">
<sub-items>
<menu-item text="Home" asp-controller="Home" asp-action="Index"></menu-item>
<menu-item text="Security Information" asp-controller="Home" asp-action="Security_Information"></menu-item>
</sub-items>
</menu-item>
</items>
</kendo-menu>
3. The "Security Information" Menu item is not visible when the user is logged as "Admin" or as "User".
### Expected/desired behavior
The "Security Information" Menu item should be visible when the [Authorize(Roles = "Admin, User")] attribute is added to the respective Action/Controller and the user is logged as "Admin" or as "User".
### Environment
* **Telerik UI for ASP.NET Core version: 2023.2.606
* **Browser: [all]
Currently, the Telerik UI for ASP.NET Core Form wrappers does not expose an overload for passing Template Component via the ButtonsTemplate API configuration. In comparison to its ASP.NET MVC counterpart. E.g:
** HtmlHelper **
@(Html.Kendo().Form()
.Name("form")
.ButtonsTemplate(Html.Kendo().Template().AddHtml("<button>Submit</button>"))
)
** TagHelper **
<kendo-form name="formExample" action="Index" method="POST">
<buttons-template>
<kendo-button name="test">
Some Test
</kendo-button>
</buttons-template>
</kendo-form>
It would be beneficial if the configuration accepts a Template Component overload similar to the ButtonsTemplate API in the MVC wrappers.
The Form Core wrappers do not expose a Template component option for the Buttons Template.
The Form Core wrappers should expose a Template component option for the Buttons Template.
### Bug report
The ContextMenu does not show when the mouse is moved normally. It will show only when the mouse is moved very slowly.
### Reproduction of the problem
1. Create a Grid with a custom column command.
2. Define a ContextMenu that will be displayed when the custom column command is clicked.
3. Click over a specified column command - the ContextMenu opens.
4. Move the mouse over another row and click the custom column command - the ContextMenu does not open.
A Dojo sample for reproduction: https://dojo.telerik.com/aYiVUzum
### Current behavior
The ContextMenu does not open over every item as expected.
### Expected/desired behavior
The ContextMenu must open when clicking each item.
#### The issue is a regression starting with 2023.1.314 version
### Workaround
Add the following script before the ContextMenu initialization:
<script>
function contains(parent, child) {
try {
return $.contains(parent, child);
} catch (e) {
return false;
}
}
kendo.ui.ContextMenu.fn.open = function (x, y) {
var OPEN = "open",
ACTIVATE = "activate",
DOCUMENT_ELEMENT = $(document.documentElement),
NS = ".kendoMenu";
var that = this;
x = $(x)[0];
if (contains(that.element[0], $(x)[0]) || that._itemHasChildren($(x))) { // call parent open for children elements
kendo.ui.Menu.fn.open.call(that, x);
} else {
if (that._triggerEvent({ item: that.element, type: OPEN }) === false) {
if (that.popup.visible() && that.options.filter) {
that.popup.close(true);
that.popup.element.parent().kendoStop(true);
}
if (!that._triggerFocusOnActivate) {
that._triggerFocusOnActivate = that._focusMenu.bind(that);
}
that.bind(ACTIVATE, that._triggerFocusOnActivate);
if (y !== undefined) {
var overflowWrapper = that._overflowWrapper();
if (overflowWrapper) {
var offset = overflowWrapper.offset();
x -= offset.left;
y -= offset.top;
}
that.popup.wrapper.hide();
that._configurePopupScrolling(x, y);
that.popup.open(x, y);
} else {
that.popup.options.anchor = (x ? x : that.popup.anchor) || that.target;
that.popup.element.parent().kendoStop(true);
that._configurePopupScrolling();
that.popup.open();
}
DOCUMENT_ELEMENT.off(that.popup.downEvent, that.popup._mousedownProxy);
DOCUMENT_ELEMENT
.on(kendo.support.mousedown + NS + that._marker, that._closeProxy);
}
}
return that;
};
</script>
### Environment
* **Kendo UI version: 2023.1.314
* **Browser: [all]
ComboBox is not serialized correctly when declared in the Template component
The ComboBox is not serialized correctly when declared in the Template component.
The ComboBox should be serialized correctly when declared in the Template component.
In a .NET 7 project when TagHelper Grid is configured and RuntimeCompilation is employed, starting from version 2023.2.606 an unhandled exception is thrown.
When run a runtime error occurs
TagHelper Grid should exhibit the same behavior as HtmlHelper ones.
Currently, the only way to nest conventional HTML tag content for the Template Component would be through the following configuration
@(Html.Kendo().Template()
.AddHtml("<div>")
.AddHtml("<p>Test</p>")
.AddHtml("</div>")
)
It would be beneficial if the configuration accepts a delegate overload that would allow transpose the previous configuration to the following
@(Html.Kendo().Template()
.AddHtml(@<text>
<div>
<p>Some Value</p>
</div>
</text>)
)
Currently, the Template component does not expose a delegate overload for the .AddHtml()
API configuration.
The Template component should expose a delegate overload for the .AddHtml()
API configuration.
The TimeDurationPicker sets the following value: 01 01 01 01
The TimeDurationPicker sets the following value: 01 00 00 00
Hi this is a pretty basic bug. But I am using the k-i-cancel icon class but for some reason it is showing the settings icon?
I have an editable kendo grid in which I have a date field. When I choose a date through the calendar for example: 26.12.2021 on post the model binder parses the date correctly.
If I manually enter the date in the cell the model binder parses the date as it was not an UTC and since my time zone is +2h it comes in the controller as 25.12.2021 22:00
(see the attached files)
Inside my startup.cs I have defined JsonOptions like this:
.AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
});
In the Configure method:
var supportedCultures = new[] { new CultureInfo("bg-BG") };
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("bg-BG"),
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures
});
Layout.cshtml
<script src="~/lib/kendo/js/cultures/kendo.culture.bg-BG.min.js"></script>
<script>
kendo.culture("bg-BG");
</script>
This is a strange bug I came across when making a simple grid for a small personal project. I created a class called Book, which looks like this:
[Table("Books")]
public class Book
{
[Key]
public int Id { get; set; }
[Required]
public string Title { get; set; } = null!;
public Checkout? Checkout { get; set; }
[NotMapped]
public bool CheckedOut => Checkout != null;
}
I then created a simple Razor view on which to show the books on a grid. Here is what the code for the page looks like:
@{
ViewData["Title"] = "All Books";
}
@(
Html.Kendo().Grid<LibraryMvc.Core.Entities.Book>()
.Name("bookGrid")
.Pageable(p => {
p.PageSizes(new[] {20, 50, 100 });
p.Numeric(true);
p.Input(true);
})
.Editable(e => e.Mode(GridEditMode.InLine))
.Filterable()
.Sortable()
.Scrollable()
.ToolBar(t => t.Create())
.Columns(col => {
col.Bound(c => c.Id).Title("ID");
col.Bound(c => c.Title).Title("Title");
col.Bound(c => c.CheckedOut).Title("Checked Out");
col.Command(com => {
com.Edit();
com.Destroy();
}).Title("Manage");
})
.DataSource(ds =>
ds.Ajax()
.PageSize(20)
.Model(md => {
md.Id(f => f.Id);
md.Field(f => f.Id).Editable(false);
md.Field(f => f.CheckedOut).Editable(false);
})
.Read(r => r.Action("Book_Read", "Book"))
.Create(c => c.Action("Book_Create", "Book"))
.Update(c => c.Action("Book_Update", "Book"))
.Destroy(c => c.Action("Book_Destroy", "Book"))
)
)
When running my app with this code, I noticed that client-side validation would not work on the grid. Nothing would stop me from adding multiple Book rows with empty Titles, despite Title being a [Required] property based on my Book class's Data Annotations:
I assumed I did something wrong, so I scoured the internet and Telerik's support items in hopes of finding something, but then I came across this when inspecting the page's elements in Chrome's dev tools:
Look at the script tag. For whatever reason, the kendoTextBox ended up using the Razor view's ViewData["Title"] property. Oops!
To work around this, I ended up changing my Book class's Title field to BookTitle, as shown below:
[Table("Books")]
public class Book
{
[Key]
public int Id { get; set; }
[Required]
[Column("Title")]
public string BookTitle { get; set; } = null!;
public Checkout? Checkout { get; set; }
[NotMapped]
public bool CheckedOut => Checkout != null;
}
With this property name changed, I was able to get client-side validation to work as needed:
A second workaround involved getting rid of the ViewData["Title"] definition on my Razor view:
Given all this, it looks like something that's generating the client-side validation on the page is getting tripped up over the word "Title" being used by multiple items on the page.
Starting from 2024.1.130 when the TreeList's Edit mode is configured to be InCell and the user interacts with the caret icon instead of collapsing/expanding appropriately the Component enters edit mode for the first column of the row.
Collapsing and expanding of the TreeList should work correctly upon user interaction.
In the NumericTextBox when its options are reconfigured with the setOptions method and the max
property is set to be larger than the value of the widget the number in the k-inner-input gets hidden until the input gets focused.
Change Decimal
buttonThe value within the input disappears until the inputs is refocused by the user.
The value shouldn't change, if it is larger that the one configured in the max
property.
Template Component is not reinitialized when the pane is pinned and unpinned in the DockManager
The Component residing in the pane content is not reinitialized when the pane is pinned and unpinned.
The Component residing in the pane content should be reinitialized when the pane is pinned and unpinned.
Regression introduced with 2024.1.130. Likely related to: #7650
Workaround: remove "px" from the width values, e.g.,
width: "80"
The columns ignore their width setting and each column has 1/3 of the Grid's width.
The columns widths are proportionate to the specified width values (as in R3 2023 SP1).
When the GroupPaging configuration is present the exported Grid doesn't have any data.
The exported Excel only contains headers and footers
The whole content of the Grid must be exported.