At moment the "ForeignKey" method supports only predicates. Is it possible to implement a String overload (a screenshot is attached)?
Currently, the TagHelper Grid cannot bind to local DataSource as in the HtmlHelpers: https://demos.telerik.com/aspnet-core/grid/local-data-binding
Is it possible to implement it?
Hello,
When you add any kind of filter to the grid, he is wrapped inside span with class "k-filtercell". It would be very usefull to add HtmlAttributes to the html element. Last time i wanted to add class only on the filtercell so i can customize the ui to match our theme. The idea was to have expression for each filter type so i can create css only for the filters. Most of the expressions were ok, because they were wrapped inside Template. But in cases like enum i dont want template, i want only to add class to the filtercell, so i can change it. Its not ok for one types to do the changes with filter expression, for other types to make changes with column.HtmlAttributes(...).
If not HtmlAttributes, at least .Class(...).
Regards,
Dinko
Per the documentation for the Grid's Search Panel:
"When the server operations are enabled, you can search only by using string fields."
This is an oddly-specific limitation to have that causes an awkward user experience. Grids in some areas with limited data might use client operations and, as a result, the Search Panel is capable of searching all columns in a Grid. Other areas, however, might have grids with significantly more data and be using server operations for performance reasons. A side-effect of this would mean the Search Panel is incapable of filtering on non-string fields. This not only might lead to unexpected results to an end-user, but also requires the developer to explicitly list each string field that can be searched. If a developer forgets to list only string fields, the default action will be for it to attempt to filter on all fields. If any fields happen to not be strings, you still get a loading indicator as if it's attempting to filter, but the Ajax request silently fails and returns an error 500 behind the scenes.
There are some manual workarounds discussed here, as well as some information as to why this limitation exists. It seems like the problems causing these limitations are known, as are some rough workarounds to get around it. It would be great if we could get some official support to address this limitation so developers aren't left to either work around it on their own or avoid using this feature altogether. This feature would be great if it weren't for this limitation. A single place to quickly and easily type in something to filter on, and have that filter applied against all columns could definitely save some time and be very useful, but with this limitation with a pretty technical explanation (from an end-user perspective), the unexpected mixed results could instead lead to confusion and frustration, and distrust of this feature.
Hi Kendo Team,
I am working on Kendo UI ASP.NET Core Grid binding with SignalR. But while starting Hub and providing the Promise, I am facing an error "The "promise" option must be a Promise."
I am following this URL for reference: https://demos.telerik.com/aspnet-core/grid/signalr .
Checked on your website as well, but the issue is also coming there. Here is the URL: https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/transport.signalr
In this link, when clicking on "Open In Dojo" button, it opens a new window, then clicks on the Run button. It will generate an error in the console "Uncaught Error: The "promise" option must be a Promise.".
Please check the attached snapshot.
Please reply asap. Thanks in advance!
Currently a DateTime property of a nested object does not get parsed when used as a column in the Grid:
public class MyClass
{
public MyOtherClass Item{get;set;}
}
public class MyOtherClass
{
public DateTime CreatedAt{get;set;}
}
and Formatting cannot be applied:
columns.Bound(p => p.Item.CreatedAt).Title("Time").Format("{0:D}");
Hi Team,
I'd like to request adding a configuration to the Kendo UI Grid or ExcelExport event which would be a setting to autofit the Excel sheet columns instead of changing the workbook.sheets.columns.autowidth.
Thank you!
It will be great if we can have a very simple "out-of-the-box" way to add a Column Chooser in the toolbar, similar to the Search Feature.
Something like Syncfusion's column chooser here:
https://ej2.syncfusion.com/aspnetcore/Grid/ColumnChooser
This will help me significantly in my development effort and provide a much better experience for my paying customers.
I have hundreds of grid tables with different schemas, columns with MinScreenWidth, and hidden columns (depending on the availability of data).
On a page, it can have multiple grid tables that are dynamically generated.
I also use View Component to generate each grid table.
The current column menu isn't perfect because I want it to only act as a filter checkbox, not a menu where a user needs to click twice to access the filtering feature. (And my users need to use the filtering mechanism A LOT)
Thanks,
Luke
Add GroupPaging method to the configuration of the Custom DataSource in Telerik UI for ASP.NET Core as available for Telerik UI for ASP.NET MVC.
Example: https://demos.telerik.com/aspnet-mvc/grid/grouppaging
The Kendo UI Grid's pager for UI for ASP.NET Core does not have an "All" option and it can't be configured in the Razor syntax.
Using the Kendo UI Grid's pageable.PageSizes, the ALL option is not available for UI for ASP.NET Core as it's only an Int32[].
The All option should be included like in the UI for ASP.NET MVC Razor Syntax.
Bug report
The Kendo UI Sortable for ASP.NET Core assumes that all selectors are by "id".
Reproduction of the problem
1. Set the .For() option of the Sortable widget to a class selector:
@(Html.Kendo().Sortable() .For(".k-grid table") // . . . )
2. Inspect the page source.
3. The following string is rendered:
<script>
kendo.syncReady(function () { jQuery("\\.k-grid table").kendoSortable(// options) });
</script>
Expected/desired behavior
The Sortable widget should allow for passing any jQuery selectors.
Environment
* **Kendo UI version:** 2019.3.1023
* **jQuery version:** 1.12.4
* **Browser:** [all]
Hi folks!
I am using the Grid's ColumnMenu with its new ComponentType-property set to "modern" like this:
@(Html.Kendo().Grid<my_fancy_web_application.ViewModels.ProjectListViewModel>()
.Name("myGrid")
.Editable(editable => editable.Mode(GridEditMode.InLine).DisplayDeleteConfirmation("Willst Du diesen Eintrag wirklich löschen?"))
.Sortable()
.Scrollable()
.Pageable(pageable => pageable.Enabled(false))
.ColumnMenu(columnMenu => columnMenu.ComponentType("modern"))
// ... going on with some further definitions
)
In the <head>-Tag of my _Layout.cshtml file, I have set the Kendo Culture to Swiss German:
<script>kendo.culture("de-CH")</script>
What I now observed is, that the buttons "Apply" and "Reset" did not get translated properly and remain in English (see Column_Menu_Reset_Apply_Button.png). Whereas other messages are correctly translated.
I tried to find out which message property was set there, so that I could add it manually to the "kendo.messages.de-CH.min.js" (as by the way I still have to do for e.g. the Grid's searchbar placeholder "Search...").
In the loaded kendo.all.min.js (2021.1.330) I discovered, that there was no message property in place, and the texts were rather hard-coded:
'<div class="k-columnmenu-actions">' + '<button class="k-button" type="button">Reset</button>' + '<button class="k-button k-primary" type="button">Apply</button>' + '</div>' + '</div>'
With the Chrome's dev tools and the source map, I found the above code on line 55815 by searching for the class "k-columnmenu-actions".
Could you please change the mentioned code to make use of the kendo.messages-properties and update the culture-specific kendo.messages files accordingly?
Thanks in advance!
Kind regards,
Janick
The ability to export a grid to excel has been a great addition, we would like the ability to export in CSV and XML also.
Hi!
We're using a drop down list as a grid cell's edit template, but.. our users are unable to properly edit the rows at the bottom of the grid due to drop down list going off the page, and closing when they attempt to scroll.
any ideas?
When you create a Grid using a TModel that inherits from DynamicObject, a type cast exception is thrown when setting the DataSource Model Id property.
public class Metadata : DynamicObject{
...
}
...
.DataSource(dataSource =>
{
dataSource.Ajax()
.Model(model =>
{
model.Id("Id");
});
})
A type cast exception is thrown by the following line in Kendo\AspNet.Core\Kendo.Mvc\UI\DataSource\Fluent\DataSourceModelDescriptorFactoryBase.cs because ModelDynamicDataKey is not generic, so it cannot be cast to IDataKey<TModel>
dataKey = (IDataKey<TModel>)new ModelDynamicDataKey(fieldName, lambdaExpression);
The following code changes fix the issue:
DataSourceModelDescriptorFactoryBase.cs
namespace Kendo.Mvc.UI.Fluent
{
using System.Reflection;
using Extensions;
/// <summary>
/// Defines the fluent interface for configuring the <see cref="DataSource"/> Model definition.
/// </summary>
/// <typeparam name="TModel">Type of the model</typeparam>
public abstract class DataSourceModelDescriptorFactoryBase<TModel> : IHideObjectMembers
where TModel : class
{
protected readonly ModelDescriptor model;
public DataSourceModelDescriptorFactoryBase(ModelDescriptor model)
{
this.model = model;
}
/// <summary>
/// Specify the member used to identify an unique Model instance.
/// </summary>
/// <param name="fieldName">The member name.</param>
protected void Id(string fieldName)
{
IDataKey<TModel> dataKey;
if (typeof(TModel).IsDynamicObject())
{
var lambdaExpression = ExpressionBuilder.Expression<TModel, object>(fieldName);
dataKey = new ModelDynamicDataKey<TModel>(fieldName, lambdaExpression);
}
else
{
dataKey = GetDataKeyForField(fieldName);
}
dataKey.RouteKey = dataKey.Name;
model.Id = dataKey;
}
protected IDataKey<TModel> GetDataKeyForField(string fieldName)
{
var lambdaExpression = ExpressionBuilder.Lambda<TModel>(fieldName);
var fieldType = typeof(ModelDataKey<,>).MakeGenericType(new[] { typeof(TModel), lambdaExpression.Body.Type });
var constructor = fieldType.GetConstructor(new[] { lambdaExpression.GetType() });
return (IDataKey<TModel>)constructor.Invoke(new object[] { lambdaExpression });
}
}
}
ModelDynamicDataKey.cs
namespace Kendo.Mvc.UI
{
using System;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Mvc.Rendering;
internal class ModelDynamicDataKey<TModel> : IDataKey<TModel>
where TModel : class
{
public ModelDynamicDataKey(string memberName, Expression<Func<TModel, object>> expression)
{
RouteKey = "id";
Name = memberName;
Expression = expression;
Value = expression.Compile();
}
public string Name
{
get;
}
public string RouteKey
{
get;
set;
}
public Func<TModel, object> Value
{
get;
}
public Expression<Func<TModel, object>> Expression
{
get;
}
public object GetValue(object dataItem)
{
try
{
return Value((TModel)dataItem);
}
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
{
return null;
}
}
public string HiddenFieldHtml(IHtmlHelper<TModel> htmlHelper)
{
return htmlHelper.Hidden(Name, null, new { id = "" }).ToString();
}
}
}
Bug Report
Ticket ID:1486632
When using groupable.sort.compare with client operations and groupPaging, a JavaScript error is thrown:
Reproduction
Environment
2020.3.915
Hi,
We have a property EnableHeaderContextAggregateMenu in Radgrid. By enabling this, we can aggregate any column in the Radgrid and show the result value in the corresponding column footer at runtime by the end user.
Do we have similar property in Kendo UI Grid? We need to implement this in Kendo UI Grid which has dynamic column data binding. We had attached a sample code here. Can you please implement the same in the code and revert?
Thanks & Regards,
Shivakumar. K
I posted this in the forums but didn't get a response so I'll try here. Per this link, and other forum posts I thought that when server operations are set to 'false' that non string types would work in the search box for the ASP MVC Core grid.
Documentation:
Another forum post reference:
https://www.telerik.com/forums/new-search-panel-and-datetime
My grid code is below. The 'PaymentType' Column is an enum and the search does not work for it. I have also tried adding this:
.Search(search=> { search.Field(f => f.PaymentType); })
but it didn't make a difference
@(Html.Kendo().Grid<B3.Services.LoanServices.LoanServiceModels.PaymentServiceModel>()
.Name("PaymentRegisterReport")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Payments_Read", "StandardReports", new { area = "Reports" }))
.PageSize(1000)
.ServerOperation(false)
)
.Columns(columns =>
{
columns.Bound(p => p.Date).Format("{0:MM/dd/yyyy}").Title("Date");
columns.Bound(p => p.LoanName).Title("Loan Name");
columns.Bound(p => p.PaymentType).Title("Payment Type");
columns.Bound(p => p.CheckNumber).Title("Check Number");
columns.Bound(p => p.Amount).Title("Amount").Format("{0:C}")
.HtmlAttributes(new { style = "text-align: right" }).HeaderHtmlAttributes(new { style = "text-align: right" });
})
.Pageable()
.Sortable()
.Filterable()
.HtmlAttributes(new { style = "font-size:12px" })
.ColumnMenu()
.ToolBar(t =>
{
t.Search();
t.Excel();
})
.Reorderable(l => l.Columns(true))
.Events( e =>
{
e.ColumnShow("saveKendoGridState");
e.ColumnHide("saveKendoGridState");
e.ColumnReorder("kendoGridColumnReorder");
})
)
The Custom() DataSource has capability to set the initial Page of the grid:
.PageSize(20)
.Page(4)
While the Ajax() DataSource does not. It would be nice if it gets added.
Currently, you can use the page() method for local or .Ajax() bound grid:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/page
Or query:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/query