Hi,
We are attempting to set the default values of new rows in a grid based on some user-specified filters. The desired functionality is that if, for example, the "Year Level" filter is set to "Year 1", when a new row is created it will have its Year Level value automatically set to Year 1 AND will be visible in an edit state in the grid.
We have read the previous Q&A here, however this solution is not suitable as it makes ALL rows with no "Year Level" value become visible when a new row is created.
As the "edit" event does not seem to fire when creating a new row whilst filters are applied, the implementation we are attempting involves saving those filters when the "Add" button is clicked and then re-applying them after the row has been created. This mostly works, but the new row is inserted as an un-editable dirty record and clicking its "Edit" button does nothing.
The code below is a combination of a couple of different approaches. Any guidance would be greatly appreciated!
let currentEditRow;
let currentModel;
$(".k-grid-add").click(function () {
var grid = $("#grid").data("kendoGrid");
// Save the current filters before clearing them
savedFilters = grid.dataSource.filter();
grid.dataSource.filter([]);
// Add a new row and enter edit mode
currentEditRow = grid.addRow();
grid.editRow(currentEditRow); // Attempting to force new row into edit mode here does not work
});
$("#grid").kendoGrid({
dataSource: ds,
sortable: true,
toolbar: ["create"],
columns: [
{
field: "Yearlevel",
sortable: false,
title: "Year Level",
editor: cmbEditorYearlevelForHomegroup,
template: "#=Yearlevel?.Name ?? ''#",
editable: isEditable
},
// Other columns here
{ command: ["edit", "destroy"], title: "Action", width: "180px" }],
editable: "inline",
edit: function (e) {
currentEditRow = $(e.container); // Save reference to the editing row
currentModel = e.model; // Save the current model
if (e.model.isNew()) {
var yearLevelDropdown = $("#yearLevel").data("kendoDropDownList");
e.model.set("Yearlevel", { // Update the values in the new row based on the selected filters
Code: yearLevelDropdown.value(),
Id: 0,
Name: yearLevelDropdown.text()
});
var grid = $("#grid").data("kendoGrid");
if (savedFilters) {
grid.dataSource.filter(savedFilters); // Re-apply the filters
}
if (currentEditRow && currentModel && currentModel.isNew()) {
var grid = this;
setTimeout(function () {
grid.editRow(currentEditRow); // Attempting to re-enter edit mode for the new row; this also does not work
});
}
}
}
});

Hello, I have noticed some changes on the structure of the Treeview component after version 2024.1.319 March 18, 2024
Classes like k-group and k-in seem to have been removed completely
For example, in previous version, the structure of a Treeview component would look like this:
<ul class="k-group k-treeview-group">
<li class="k-treeview-item">
<div class="k-treeview-top">
<span class="k-treeview-leaf k-in">TEST STRING</span>
</div>
</li>
</ul>while now it would look like this:
<ul class="k-treeview-group">
<li class="k-treeview-item">
<div class="k-treeview-top">
<span class="k-treeview-leaf">
<span class="k-treeview-leaf-text">TEST STRING</span>
</span>
</div>
</li>
</ul>On release notes, I did not find any particular reference on these classes being removed
So my questions are:
Thank you in advance
Hi, I am using Telerik grid in Razor pages applications. I have main grid and Detail grid.
<script id="orderItemsTemplate" type="text/kendo-tmpl">Problem: .ToolBar(tb => tb.Columns()) is not working on Detail grid template.
After selecting a file in kendoUpload two buttons show up: Upload and Clear:
Is it possible to hide those two buttons? I want to do the upload process programmatically.
I already found out that the two buttons are not accessible after initialization of the kendoUpload widget but also not right away after the SELECT event triggers (on selecting a file to be uploaded). I have found a solution waiting some milliseconds in the SELECT event to hide the two buttons:
setTimeout(function() {
$('k-actions').css('display', 'none');
}, 10);
Is there a more proper way to hide those buttons?
I'm working with KendoUI for JQuery, very latest official version.
Regards
Hi,
I have a requirement to highlight a particular attendee with a red border in the dropdown list. The idea is to indicate that this attendee is not available at that specific date and time when someone opens the appointment pop-up (refer to the attachment). I know color option is there but i want to add red border to particular attendee. there can be situation where red border can be added to more then one attendee. Please help me understand how I can achieve this.
Thanks!
Some users do not see very clearly which is the today in the scheduler and asked if the header could be colored.
I have found that the cells has the class "k-today" but the header does not have it.
Is there a way to know which of the header cells is the cell for the today?
Hi support team,
we need filterable: { mode: "row" } to have a filter row.
We also need a DropDownList for a boolean column in the filter as described here:
https://docs.telerik.com/kendo-ui/knowledge-base/grid-boolean-dropdownlist-filter
When using this we see an ugly filter row item:
I expect to have the DropDownList in the filter row.
This worked using following MVC template syntax in the past
.Filterable(f => f.Multi(false).Cell(c => c.ShowOperators(false)
.Template(@<text>
function(args) {
args.element.kendoDropDownList({
autoBind: false,
dataTextField: "text",
dataValueField: "value" ,
dataSource: new kendo.data.DataSource({
data: [{ text: "Ja" , value: "true" },
{ text: "Nein" , value: "false" }]
}),
index: 0,
optionLabel: {
text: "Filter" ,
value: ""
},
valuePrimitive: true
})
}
</text>
is this a bug?