So I've made a hundred Kendo Grids with MVC so far and I have zero success with globalization and validation. To give a little bit more details: If we look at the demo presented here https://demos.telerik.com/aspnet-core/grid/globalization and the "Unit Price" column. You can clearly enter only numerics with only 1 delimiter depending on the culture. If you try to enter any non-numerical letter, it doesn't let you. Neither does it let you insert more than 1 delimiter (",,,,,,") or the wrong delimiter. So there's some kind of "on the fly validation" going on.
My grids don't have this. For example I have decimal columns and I can enter all letters, even non-numerics. I can type "03,,.awd923..." in a decimal column within the grid. What I have tho is culture. I think the culture I have set up works properly because when I check the kendo.cultures within JS console I can see all the info of the current culture (check image in attachments for more info).
Here's an example of one of my grids:
@(Html.Kendo().Grid<PromoComboItemGridModel>()
.Name(
"ItemGrid"
)
.AutoBind(
false
)
.Pageable(pager => pager.Refresh(
false
))
.Filterable(filterable => filterable.Enabled(
true
))
.Sortable(sortable => sortable.Enabled(
true
))
.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
.AllowCopy(
true
)
.Scrollable(a => a.Height(
"auto"
))
.Resizable(resize => resize.Columns(
true
))
.Navigatable()
.NoRecords(t.GetString(
"No records in table"
))
.Mobile(MobileMode.Auto)
.Editable(editable => editable.Mode(GridEditMode.InCell).Enabled(
true
).DisplayDeleteConfirmation(
false
))
.Events(events => events.Edit(
"onEdit"
))
.ToolBar(toolbar =>
{
toolbar.Template(@<text><span id=
"addItem"
onclick=
"addItem('ItemGrid')"
style=
'float:left'
class
=
'btn btn-xs btn-default'
>
<span
class
=
'k-icon k-add'
></span>@t.GetString(
"Add new item"
)
</span></text>);
}
)
.Columns(columns =>
{
columns.Bound(p => p.No);
columns.ForeignKey(p => p.Type, (System.Collections.IEnumerable)ViewData[
"FItemTypeEnum"
],
"IDForSysClient"
,
"Name"
).EditorTemplateName(
"FItemTypeEnumDropDown"
);
columns.Bound(c => c.Val).Visible(
false
);
columns.Bound(c => c.MaterialString).Title(t.GetString(
"Value"
)).Width(200);
columns.Bound(c => c.Quantity);
columns.ForeignKey(p => p.RewardType, (System.Collections.IEnumerable)ViewData[
"GPriceTypeEnum"
],
"IDForSysClient"
,
"Name"
).EditorTemplateName(
"GPriceTypeEnumDropDown"
);
columns.Bound(c => c.RewardVal);
columns.Command(commands =>
{
commands.Destroy().Text(t.GetString(
"Delete"
)).HtmlAttributes(
new
{ @
class
=
"btn btn-xs btn-danger"
});
}).Title(t.GetString(
"Commands"
)).Width(110);
})
.DataSource(dataSource =>
dataSource.Ajax()
.ServerOperation(
false
)
.Batch(
false
)
.PageSize(3)
.Model(model =>
{
model.Id(gridMainAlias => gridMainAlias.No);
model.Field(gridMainAlias => gridMainAlias.No).Editable(
false
);
model.Field(gridMainAlias => gridMainAlias.Type);
model.Field(gridMainAlias => gridMainAlias.Val);
})
.Events(events =>
{
events.Change(
"ItemGridChange"
);
})
)
)