By default, when the "paste" command is added, the default option is "insert" mode ("Paste (Insert)"). Is it possible to add an option that allows setting the default paste mode to "replace" ("Paste (Replace)")?
Is it possible to implement template options for the "update" and "cancel" column commands of the Grid?
For example:
$("#grid").kendoGrid({
columns: [{
command: [{
name: "edit",
template: {
update: "<button class='customUpdate'>Save</button>",
cancel: "<button class='customCancel'>Cancel</button>",
}
}]
}],
...
});
Currently, when using the default Grid search functionality and the column filter menus, we observe the following:
However, there’s a specific scenario where this does not work properly:
For example:
This functionality behaves correctly in the Telerik UI for Blazor Grid component - the search and column filters are managed as separate objects.
Is it possible to enhance the Grid filtering similar to the Blazor Grid?
Hi, is there a way to configure the grid so that when it's grouped and later sorted, the grouping state (expanded/collapsed) is preserved?
Kind Regards
Erwin
It would be convenient to have built-in MultiColumnComboBox editing for the Grid.
I was hoping the component would show the addresses formatted in columns (as per a fields list) and then return the address concatenated into a single to the grid field (e.g. from .DataTextField("FullAddress")).
I'm in the process of rewriting all Kendo components to use CSP compatible templates. I'm looking at https://docs.telerik.com/aspnet-core/html-helpers/template/overview which shows how we'd use TemplateComponentName() for popup editors and that we would need to rewrite everything in the popup editor to use Kendo Template's AddHtml or AddComponent methods.
Original:
<div class="mb-2 row required">
@Html.LabelFor(model => model.FileName, new { @class = "col-sm-4 col-form-label fw-bold text-sm-end" })
<div class="col-sm-6">
@(Html.Kendo().TextBoxFor(model => model.FileName).HtmlAttributes(new { @class = "w-100" }))
</div>
</div>
<div class="mb-2 row">
@Html.LabelFor(model => model.FileDescription, new { @class = "col-sm-4 col-form-label fw-bold text-sm-end" })
<div class="col-sm-6">
@(Html.Kendo().TextBoxFor(model => model.FileDescription).HtmlAttributes(new { @class = "w-100" }))
</div>
</div>
Rewritten:
@(Html.Kendo().Template()
.AddHtml("<div class='mb-2 row required'>")
.AddHtml(@<text>
@Html.LabelFor(model => model.FileName, new { @class = "col-sm-4 col-form-label fw-bold text-sm-end" })
</text>)
.AddHtml("<div class='col-sm-6'>")
.AddComponent(c => c.TextBoxFor(model => model.FileName).HtmlAttributes(new { @class = "w-100" }))
.AddHtml("</div></div>")
.AddHtml("<div class='mb-2 row'>")
.AddHtml(@<text>
@Html.LabelFor(model => model.FileDescription, new { @class = "col-sm-4 col-form-label fw-bold text-sm-end" })
</text>)
.AddHtml("<div class='col-sm-6'>")
.AddComponent(c => c.TextBoxFor(model => model.FileDescription).HtmlAttributes(new { @class = "w-100" }))
.AddHtml("</div></div>")
)
While this works, this markup seems much harder to read than the original. Could this be made to be simpler? Ideally I'd like to be able to drop my existing mix of html and kendo components in one method and it'd parse through to render the template properly.
When creating columns in a TagHelper Grid definition, the Width property allows only numbers:
<column field="OrderID" width="100">
</column>
This does not match the width property in the Kendo UI and HtmlHelpers Grid definitions which allow string values to be entered as well:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.width
That way, the developer will be able to add rem and other unit values in TagHelper syntax as well.
Also, it would be convenient if there is a new property similar to this:
<column field="OrderID" tooltip="Unique Number of the Order">
</column>
<column field="Freight"
html-attributes='new Dictionary<string, object>{ ["style"] = "width: 30rem;" }'>
</column>
At this stage, the ToolBar.Custom() API configuration does not expose built-in configurations for adding a handler and partial view. E.g:
@(Html.Kendo().Grid <TelerikAspNetCoreApp455.Models.OrderViewModel>()
.Name("grid")
.ToolBar(toolbar => {
toolbar.Custom().Name("Test1").ClientTemplateHandler("someHandler");
toolbar.Custom().Name("Test2").ClientTemplateView(Html.Partial("_Test2"))
})
...
)
The ToolBar.Custom() API configuration does not expose built-in configurations for adding a handler and partial view.
The ToolBar.Custom() API configuration should expose built-in configurations for adding a handler and partial view.
column-command template does not access datasource as an ordinary column template.
<kendo-grid name="grid">
<columns>
<column field="ProductID" title="ID" />
<column title="Column" template="#=columnTemplate(data.ProductID)#" />
<column title="ColumnCommand">
<commands>
<column-command name="change" template="#=columnTemplate(data.ProductID)#"></column-command>
</commands>
</column>
</columns>
<datasource type="DataSourceTagHelperType.Custom" server-filtering="true">
<transport>
<read url="@Url.Action("ServerFiltering_GetProducts", "MultiSelect")" />
</transport>
</datasource>
</kendo-grid>
<script>
function columnTemplate(productID) {
if (productID % 2 == 0)
return 'even';
else
return 'odd';
}
</script>
Reproduction of the problem:
https://netcorerepl.telerik.com/myurdlbI16kA1TM213
Current behavior:
There is no way to have a dynamic template for column commands that depends on datasource.
Expected/desired behavior:
Having column-command template as column template, making it possible to access data from datasource.
Environment:
Kendo UI version: 2024.2.514
Workaround:
As an alternative solution, I'm using data-bound event, performing a for loop to all rows, but it needs to go line by line, which is not the best solution for large data.
Hi
I'm using the popup editor to edit rows in the grid.
I'm using following javascript method to open the popup:
function editSelectedRow(name) { var grid = $('#' + name).data('kendoGrid'); var rows = grid.select(); grid.editRow(rows[0]); }
This function is called when a row is double clicked:
$("#Binders tbody").on("dblclick", "tr[role='row']", function (e) { editSelectedRow("Binders"); });
I have this code for many years now and it was never a problem.
With the latest version of the grid this code fails (the popup doesn't open) upon making a change in the popup window. As long as no changes is done to the record in the popup, there will not be a problem.
The error received is the following:
jquery-3.7.1.min.js:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'id') TypeError: Cannot read properties of undefined (reading 'id')
at HTMLTableRowElement.<anonymous> (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1814199)
at Function.each (https://code.jquery.com/jquery-3.7.1.min.js:2:3129)
at Le.fn.init.each (https://code.jquery.com/jquery-3.7.1.min.js:2:1594)
at init._persistSelectedRows (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1814160)
at init.select (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1811103)
at init._displayRow (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1779176)
at https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1894615
at Array.forEach (<anonymous>)
at init.refresh (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1894600)
at init.trigger (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:4189) undefined
When the data in the grid is refreshed, no error will occur anymore.
HOWEVER... I also have an "Edit" button on the toolbar of the grid. That buttons uses the same 'editSelectedRow' function but when that button is used, the popup window will open, even after a change to the record!!
With other words... something goes wrong when double clicking a row after an update was made.
What has changed?
Best regards,
Peter
Grid row drag and drop capabilities enhancement request.
Currently, in order to drop a row from one Grid into another empty Grid, adding a placeholder row to the empty Grid with custom logic is required: https://demos.telerik.com/kendo-ui/grid/drag-drop
It would be nice to have a more robust drag and drop functionality that doesn't rely on custom logic to such an extent.
Please ensure that FilterableMessageBuilder configurations are applied to the Filter's menu when it is placed within a ColumnMenu or expose configurations to control the messages of the Filter menu within the GridColumnMenuMessagesBuilder.
Here is an example REPL that showcases the configuration doesn't have effect
.Filterable(f => f.Messages(m =>
{
m.And("Custom And");
m.Or("Custom Or");
}))
unless ColumnMenu() is commented out.
I'm currently evaluating the ASP .Net Core Components and whilst I'm liking it so far, I have to say - the documentation leaves a lot to be desired.
At the moment, I am trying to use grid and looking at documentation, I have no idea if I am meant to be looking in Kendo.Mvc.UI.Fluent or Kendo.Mvc.UI - and when I am there and find an item, there just isn't enough detail. In addition, the demos section appears to actually be more helpful and I'm constantly looking there.
What caused me to write this is that I have simply enabled GridFilterMode.Row on an instance and whilst I like it, I want to change the default from "Is Equal To" to "Contains"... I have been experimenting for the past few hours without any luck and I'm going round in circles on documentation:
I can see that Filterable requires GridFilterMode, but the documentation is lacking - https://docs.telerik.com/aspnet-core/api/Kendo.Mvc.UI/GridFilterMode#kendomvcuigridfiltermode
I then try to find the filterable modes documentation, but, half the features/methods just don't seem to have any affect whatsoever.
Personally, I'm having great luck learning about your components from the demo section and adapting the code to suite my needs - but, if there isn't a demo, it appears to be a very hard task to learn what is and isn't possible.
It would be beneficial if the Grid exposes a built-in option for explicitly setting an arrow indicator for selected rows similar to the following: