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.
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).
CheckBox is not serialized correctly when declared in the Template component.
The CheckBox is not serialized correctly when declared in the Template component.
The CheckBox should be serialized correctly when declared in the Template component.
Expose additional API configurations for the Grid's ToolBar
As of recent releases, the Kendo UI Grid Toolbar has been substituted with the Kendo UI Toolbar. This change allows users to add the majority ToolBar.items API options apart from the built-in tools.
As noted within the Kendo UI for jQuery API documentation for the Grid's Toolbar:
"Apart from the built-in tools, the Grid fully exposes the ToolBar.items API. This way you can specify any custom tools in the widget using the components available in the ToolBar itself."
The inherited ToolBar.items API options are not available for the server-side Telerik UI Grid for ASP.NET Core and MVC wrappers as well.
It would be beneficial to the customers if the inherited ToolBar.items API options are available for the server-side Telerik UI Grid for ASP.NET Core and MVC wrappers as well.
There is an edge case in the Pager's responsive configuration. If the width is between 480 and 600 pixels both the DropDownList and Buttons that allow the user to navigate through the pages are hidden.
The buttons and dropdown are missing
The Pager should display a DropDownList for page selection when it is wide between 480 and 600px.
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.
Grid throws an error when the Filterable Column Messages TagHelper is set.
<messages />
in a column's <filterable></filterable>
TagHelper.Setting the Messages TagHelper produces the following compilation error:
The tag is not allowed by parent tag helper. Only child tags with name(s) 'cell, operators, datasource' are allowed.
Setting the Messages TagHelper should not produce the following compilation error.
Grid Filterable Button Title Message is not correctly serialized.
Set the Filterable.Messages.ButtonTitle() API Configuration as follows:
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Filterable(f => f.Messages(m => m.ButtonTitle("Filter")))
)
Hover the Filter Button Icon and notice that the buttonTitle message is applied instead.
The Filter ButtonTitle message shows its default message.
The Filter ButtonTitle should show the custom-provided message.
Grid PageSizes TagHelper attribute does not expose an IEnumerable overload
The Grid PageSizes TagHelper attribute exposes only an int[]
overload which prevents adding options such as "All".
In comparison to its HtmlHelper counterpart:
.Pageable(paging => paging.PageSizes(new object [] { 5, 10, 20, "All" }))
It would be a good idea to consider altering the page sizes to accept an IEnumerable overload.
The last checkbox selection is not disabled and allows all the columns to be removed if the menu options for the command column are explicitly set to false:
The last checkbox selection should be disabled without allowing all the columns to be removed if the menu options for the command column are explicitly set to false:
The following dojo depicts the aforementioned behavior.
### Bug report
When the pageSizes option is enabled, it is not displayed when the Grid is initialized inside a hidden container.
### Reproduction of the problem
1) Follow the instructions in this KB article to display a Grid inside a TabStrip component.
2) Enable the "pageSizes" setting.
3) The drop-down, which allows the user to change the page size is always hidden.
A Dojo sample for reproduction: https://dojo.telerik.com/uCORUHUc
The same example works correctly with version 2023.2.718.
### Expected/desired behavior
The pager must display the specified page sizes.
### Workaround
tabstrip.one("activate", function() {
grid.pager._lastWidth = 30;
grid.resize(true);
});
### Environment
* **Kendo UI version: 2023.2.829
* **jQuery version: 1.12.4
* **Browser: [all]
I am using the Grid with two editor template bound to viewdata to populate the components.
Now this is code that I wrote in 2017 that I recent upgraded to .NET 7 ASP Core and has work all those years with no issue. So I think this may be a regression in the grid code.
I have embedded the relevant code leaving out the grid views custom javascript since it isn't relevant.
The behavior that I am seen is that the the grids model properties that do NOT use a customer editor template are not being bound when the save event fires.
public class AlertRuleGridViewModel
{
public int Id { get; set; }
[UIHint("ComponentEditor")]
public string? Component { get; set; }
[UIHint("EmailAddress")]
public string? Email { get; set; }
[UIHint("TypeEditor")]
public string? Type { get; set; }
[UIHint("Boolean")]
public bool Enabled { get; set; }
}
<div class="container alert-rules-grid">
@(Html.Kendo().Grid<AlertRuleGridViewModel>()
.Name("alert-grid")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(l => l.Id);
model.Field(field => field.Id).Editable(false);
model.Field(field => field.Type).DefaultValue(ViewData["defaultType"] as String);
})
.PageSize(12)
.Sort(a => a.Add("Id").Descending())
.Read(read => read.Action("GetRules", "Alerts").Data("additionalData"))
.Create(update => update.Action("UpdateRule", "Alerts"))
.Update(update => update.Action("UpdateRule", "Alerts"))
.Destroy(destroy => destroy.Action("DeleteRule", "Alerts"))
.Events(e => e.Error("gridErrorHandler"))
)
.Columns(columns =>
{
columns.Bound(b => b.Id).Title("Id").Visible(true).Width("4%");
columns.Bound(b => b.Component).Title("Component").EditorTemplateName("ComponentEditor").Visible(true);
columns.Bound(b => b.Email).Title("Email").Visible(true);
columns.Bound(b => b.Type).Title("Log Type").EditorTemplateName("TypeEditor").Visible(true);
columns.Bound(b => b.Enabled).Title("Enabled").ClientTemplate("#=renderStatus(data)#").Visible(true);
columns.Command(command =>
{
command.Edit();
command.Destroy();
});
}
)
.ToolBar(toolBar =>
{
toolBar.ClientTemplateId("toolBarTemplate");
})
.Events(events =>
{
events.Cancel("onCancelEdit");
events.Save("onSave");
}
)
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable() // Enable paging
.Sortable() // Enable sorting
.Scrollable(s => s.Height("auto"))
.Resizable(resize => resize.Columns(true))
)
</div>
I suspect the issue is the generated html for the input that used the editor template.
The data-bind attribute is set to "value:Component.Component" which should be "value:Component"<td class="k-table-td" role="gridcell" data-container-for="Component">
<span class="k-input k-combobox k-combobox-clearable k-input-solid k-input-md k-rounded-md k-valid" style="">
<input name="Component.Component_input" class="k-input-inner k-valid" type="text" autocomplete="off" title="" role="combobox" aria-expanded="false" style="" tabindex="0" aria-disabled="false" aria-readonly="false" aria-busy="false" aria-autocomplete="none" aria-controls="Component_Component_listbox" data-bind="value:Component.Component_input">
<span unselectable="on" class="k-clear-value k-hidden" title="clear" role="button" tabindex="-1">
<span class="k-svg-icon k-svg-i-x" aria-hidden="true">
<svg viewBox="0 0 512 512" focusable="false" xmlns="http://www.w3.org/2000/svg">
<path d="M416 141.3 301.3 256 416 370.7 370.7 416 256 301.3 141.3 416 96 370.7 210.7 256 96 141.3 141.3 96 256 210.7 370.7 96l45.3 45.3z"/>
</svg>
</span>
</span>
<button type="button" class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button" aria-label="expand combobox" role="button" tabindex="-1">
<span class="k-svg-icon k-svg-i-caret-alt-down k-button-icon" aria-hidden="true">
<svg viewBox="0 0 512 512" focusable="false" xmlns="http://www.w3.org/2000/svg">
<path d="M256 352 128 160h256L256 352z"/>
</svg>
</span>
</button>
<input id="Component_Component" name="Component.Component" type="text" value="" data-role="combobox" aria-disabled="false" aria-readonly="false" style="display: none;" data-bind="value:Component.Component"/>
<script>kendo.syncReady(function(){jQuery("#Component_Component").kendoComboBox({"dataTextField":"Name","dataValueField":"Value","valuePrimitive":true,"dataSource":[{"Name":"AppLog.Common.Test","Value":"AppLog.Common.Test"},{"Name":"AppLog.WebAPI","Value":"AppLog.WebAPI"},{"Name":"BadgeReader","Value":"BadgeReader"},{"Name":"CCS.WebUI","Value":"CCS.WebUI"},{"Name":"LVCVA.AppLog.Internal.Web","Value":"LVCVA.AppLog.Internal.Web"},{"Name":"LVCVA.AppSecurity.Domain","Value":"LVCVA.AppSecurity.Domain"},{"Name":"Registration.WPF.UI","Value":"Registration.WPF.UI"},{"Name":"spLogApplicationMessage","Value":"spLogApplicationMessage"}]});});</script>
<span class="field-validation-valid" data-valmsg-for="Component" data-valmsg-replace="true"/>
</td>
<td class="k-table-td" role="gridcell" data-container-for="Type">
<span title="" class="k-picker k-dropdownlist k-picker-solid k-picker-md k-rounded-md k-valid" unselectable="on" role="combobox" aria-expanded="false" tabindex="0" aria-controls="Type_Type_listbox" aria-disabled="false" aria-readonly="false" aria-busy="false" aria-describedby="e73b8727-5e28-4d9b-9faa-df8239f54aa5" style="">
<span id="e73b8727-5e28-4d9b-9faa-df8239f54aa5" unselectable="on" class="k-input-inner">
<span class="k-input-value-text"/>
</span>
<span role="button" class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button" aria-label="select" type="button">
<span class="k-svg-icon k-svg-i-caret-alt-down k-button-icon" aria-hidden="true">
<svg viewBox="0 0 512 512" focusable="false" xmlns="http://www.w3.org/2000/svg">
<path d="M256 352 128 160h256L256 352z"/>
</svg>
</span>
</span>
<input id="Type_Type" name="Type.Type" type="text" value="" data-role="dropdownlist" style="display: none;" data-bind="value:Type.Type"/>
<script>kendo.syncReady(function(){jQuery("#Type_Type").kendoDropDownList({"dataTextField":"Type","dataValueField":"Value","valuePrimitive":true,"dataSource":[{"Type":"Critical","Value":"Critical"},{"Type":"Error","Value":"Error"},{"Type":"Warning","Value":"Warning"},{"Type":"Information","Value":"Information"},{"Type":"Verbose","Value":"Verbose"},{"Type":"Start","Value":"Start"},{"Type":"Stop","Value":"Stop"},{"Type":"Suspend","Value":"Suspend"},{"Type":"Resume","Value":"Resume"}]});});</script>
<span class="field-validation-valid" data-valmsg-for="Type" data-valmsg-replace="true"/>
</td>
Grouping a column with Group Paging and Client Operations enabled results in slow performance in comparison to prior versions.
The grouping functionality for the Grid with client operations and group paging would produce approximately 10 times slower results in terms of execution. In comparison to previous versions.
The grouping functionality for the Grid with client operations and group paging should produce identical time execution to prior versions, as illustrated in the following dojo.
Currently, the ASP.NET Core Grid Columns's Template() method does not expose the ability to provide a delegate. In comparison to the ASP.NET MVC Grid Column's Template() method:
It would be useful to add this option to the ASP.NET Core Grid, as it will allow the configuration for multiline templates. For example:
.Columns(columns =>
{
columns.Template(@<text>
<div>#= OrderID # </div>
<div>#= Discontinued # </div>
</text>);
})
The Columns.Template() method of the Grid does expose a delegate overload.
The Columns.Template() method of the Grid should expose a delegate overload.
When a Grid's row is reordered and then the changes are saved - a Destroy request is sent to the server for the dataItem of the reordered row. This happens even though no changes are applied to dataItem of the reordered row.
The Grid should request the reordered item to be perished from the backend.
In the latest version (2023.2.718), the Column Menu in the Grid faild to open if you set the Groupable option to false.
To reproduce the issue simply change the line below in the Grid Overview Demo
.Groupable(g=>g.ShowFooter(false))
to the following:
.Groupable(false)
https://netcorerepl.telerik.com/cxkhGOvU52pBO4NK33
The error you get when clicking on the Column Menu is:
Uncaught TypeError: Cannot read properties of undefined (reading '_canDrag') at init._updateGroupColumns (kendo.all.js:321370:19) at init._open (kendo.all.js:321370:19) at init.trigger (kendo.all.js:321370:19) at init._trigger (kendo.all.js:321370:19) at init.open (kendo.all.js:321370:19) at init.toggle (kendo.all.js:321370:19) at init._click (kendo.all.js:321370:19) at HTMLAnchorElement.dispatch (jquery.min.js:3:12445) at r.handle (jquery.min.js:3:9174)
### Bug report
When dragging and dropping a row within the Grid, the DOM element of the drag handle receives duplicated classes and styles.
### Reproduction of the problem
1) Enable the Drag & Drop functionality of the Grid.
2) Drag and drop a row within the Grid.
3) Inspect the DOM element of the drag handle - it has multiple duplicated classes and styles:
A Dojo sample for reproduction: https://dojo.telerik.com/IRotEKEX
### Environment
* **Kendo UI version: 2023.2.606
* **jQuery version: 1.12.4
* **Browser: [all]
When tabbing in a batch editable Grid cells do not enter edit mode.
This is a regression introduced with v 2023.2.606.
The corresponding Unit Price is focused, but an editor is not generated
The cell should enter edit mode, as with v2023.1.425 - dojo
Group Paging is not working as expected when the Kendo UI Grid is populated from data deserialized from a file and multiple groups are defined.
Using the UI for ASP.NET Core Grid, populate it with a file, set GroupPaging to true, add more than one group, and set the default serialization:
builder.Services.AddControllersWithViews()
.AddJsonOptions(options =>
options.JsonSerializerOptions.PropertyNamingPolicy = null);
@(Html.Kendo().Grid<MyViewModel>()
.Name("grid")
.Groupable()
.Scrollable(s=>s.Virtual(true))
.DataSource(dataSource=>dataSource
.Ajax()
.GroupPaging(true)
.PageSize(50)
.Read("ReadFromFile", "HomeController")
.Group(x=>
{
x.Add(y=>y.Group1);
x.Add(y=>y.Group2);
})
)
//...)
With multiple groups, the follow error message will appear:
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at Kendo.Mvc.Infrastructure.Group.InitializeSubgroups()
at SubgroupsGetter(Object )
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWriteAsObject(Utf8JsonWriter writer, Object value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Converters.IEnumerableConverter`1.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.WriteCoreAsObject(Utf8JsonWriter writer, Object value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteCore[TValue](JsonConverter jsonConverter, Utf8JsonWriter writer, TValue& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Mvc.Infrastructure.SystemTextJsonResultExecutor.ExecuteAsync(ActionContext context, JsonResult result)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Server GroupPaging should work as expected with multiple groups and the default serialization that is delivered with ASP.NET Core. An example would be this live demo.
Use the Newtonsoft library to set the serialization options for the application:
builder.Services.AddControllersWithViews()
.AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver());
The second criterion DropDownList in the Filter Menu does not show records upon interaction:
The second criterion DropDownList in the Filter Menu should show records upon interaction: