When using th-TH culture and setting a valid name for a component an exception InvalidOperationException: Name cannot contain spaces.
is thrown.
An InvalidOperationException: Name cannot contain spaces.
is thrown.
Exception should not be thrown and components should be rendered as expected.
Our immediate need is for the MaskedTextBox.
And have modified my program.cs to add:
// Add services to the container.
builder.Services.AddControllersWithViews()
// Maintain property names during serialization. See:
// https://github.com/aspnet/Announcements/issues/194
.AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver());
// Add Kendo UI services to the services container"
builder.Services.AddKendo();
I copied the code from your demo into the ASP.net 6.0 Page above.
I added data properties to the Index.cshtml.cs model and changed the Value property on each Kendo object to point them. That works fine
The issue is that the formatting is not applied:
It would be useful to have a grid operator for "IN" conditions. Right now we only have 2 options for an OR without having to use a custom filtering and custom clearing functions.
We have a lot of data that needs to be filtered that is not sequential. For example purposes:
Given that a customer has a standing purchase order for parts over time.
Given that serial numbers on said parts will not be sequential and may not be even be similar enough for wildcards (if that feature is provided.)
Given that we need to filter grid data to retrieve customer number, purchase order and a set of serial numbers, we need the equivalent of:
SELECT * FROM testdatatable WHERE customer = '#####' AND purchaseorder = '#####' AND serialnumber IN ('abciqwe', 'cid235', 'sn34087', 'hpk2679');
which would be WHERE WHERE customer = '#####' AND purchaseorder = '#####' AND (serialnumber = 'abciqwe' OR serialnumber = 'cid235' OR serialnumber = 'sn34087' OR serialnumber 'hpk2679');
So basically I would like to have the ability to have multiple OR statements and the operand could be 'contains' or 'not contains' as that would probably work better than "equal".
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.
https://docs.telerik.com/aspnet-core/html-helpers/editors/dropdownlist/binding/razor-page
My license doesn't include support so this is the only way I could reach out to you. On this page, the line
.Read(r ==> r
should have => instead of ==>. When I pasted this into visual studio, it was giving me completely unrelated error and took me a bit to figure out what was wrong. Please fix the typo.
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?
The 'footer' attribute in the TagHelpers for both the DatePicker and DateTimePicker does not result in any corresponding markup / Javascript configuration on the page created by the view.
See https://netcorerepl.telerik.com/QxaPwpPt57ypaI4307
Dear Telerik
The feature is related to https://www.telerik.com/account/support-center/view-ticket/1594775 this thread.
It is related to a product environment.
Scenario:
Request:
Please can Telerik create functionality along the lines of:
$("#SomeGrid").data("kendoGrid").setOptions($("#SomeGrid").data("kendoGrid").mergeOptions(OptionsSaved, OptionsNew));
KR
David
Hi,
From: Edit in Telerik REPL
https://demos.telerik.com/aspnet-core/gantt
Results:
One or more compilation failures occurred: /Views/Snippet.cshtml(24,18): Error RZ1006: The section block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.
Thanks
Andreas
I am using TreeList for setting permissions. It seemed a perfect choice until I realized that state of ALL the checkboxes is set to either true or false.
I would like to be able to select checkbox based on the value of record i.e. to be able to save it's state in database, retrieve it, and batch update it.
I know that this behavior can be simulated / achieved by using javascript, but it would be so much better, easier and neater to have it data bound just like all the other columns.
For example, I have an organisational structure on the picture below. We can set permissions on any level.
I imagine that the syntax could be something like:
@(Html.Kendo().TreeList<OrgStrukturaTree>()
.Name("treeOrgRO")
.Columns(columns =>
{
columns.Add().Selectable(true).Width("20px");
columns.Add().Field(e => e.Opis).Width(250);
})
.Filterable(false)
.Sortable(true)
.DataSource(dataSource => dataSource
.Read(read => read.Action("ObjektiTree_Read", "Admin"))
.ServerOperation(false)
.Model(m => {
m.Id(f => f.Id);
m.ParentId(f => f.ParentId);
m.Expanded(true);
m.Selected(f => f.Selected);
m.Field(f => f.Opis);
})
)
)
I sincerely hope you would consider this update, as I cannot think of a scenario when I would use checkboxes that are all the same state.
Thank you in advance.
Adding an AdaptiveMode configuration to Editors, similar to UI for Blazor would be beneficial when UI for ASP.NET Core components are used on smaller screens/mobile devices:
https://demos.telerik.com/blazor-ui/dropdownlist/adaptive
When using the ASP.NET Core helpers for input elements, it shall be possible to specify separate id and name attributes.
Example
Currently, when rendering a checkbox:
Html.Kendo()
.CheckBox()
.Name("enable")
Results in:
<input id="enable" name="enable" type="checkbox" value="true" data-role="checkbox" class="k-checkbox k-checkbox-md k-rounded-md">
As you can see, this sets both the id AND name attributes to the same string. For more advanced web pages, this is not sufficient. The id attribute must be unique within the the whole page, whereas name does not.
Suggested solution
Add a new InputName() helper method to explicitly set the name for all applicable form/input elements. This is possible with e.g. RadioGroup, but not with CheckBox, RadioButton, DropDownList, etc.
Test Environment:
OS Version: 22H2 OS Build 22621.1702
Edge Version: Edge(Chromium) Version 114.0.1823.37 (Official build) (64-bit)
Pre requisites:
High contrast mode: Settings->Accessibility->contrast themes-> select Aquatic/desert theme
Repro-Steps:
Users with low vision and who rely on high contrast aquatic and desert theme will face difficulties if the selected date is not visible clearly.
### Bug report
When the deferred scripts are created, the script source points at the root of the application instead of the application's root directory.
### Reproduction of the problem
Enable the global deferred initialization and call the @(Html.Kendo().DeferredScriptFile()) method.
The rendered script tag is: <script src="/kendo-deferred-scripts-XXXX.js"></script>
But it must be: <script src="/MyWebsite/kendo-deferred-scripts-XXXX.js"></script>
### Solution:
If you add a tilde in the Url.Content(), the generated script file must be located as expected:
public HtmlString DeferredScriptFile(string nonce = "")
{
...
var scriptResult= hasDeferredScritps ? $@"<script src=""{urlHelper.Content("~/kendo-deferred-scripts-" + guid + ".js")}"" {(string.IsNullOrEmpty(nonce) ? "" : "nonce=" + '"' + nonce + '"')}></script>" : "";
var styleResult = hasDeferredStyles ? $@"<link href=""{urlHelper.Content("~/kendo-deferred-styles-" + guid + ".css")}"" {(string.IsNullOrEmpty(nonce) ? "" : "nonce=" + '"' + nonce + '"')} rel=""stylesheet""></link>" : "";
return new HtmlString(scriptResult + System.Environment.NewLine + styleResult);
}
### Environment
* **Telerik UI for ASP.NET Core version: 2023.3.1114
* **Browser:** [all]