I'm currently implementing a grid with in cell editing in which one of the columns is a forign key column bound to a select list with 1000+ entries.
Each time a user clicks on the forign key column there is a several second delay (during which I assume the dropdown is rendering) before the dropdown appears.
Once the dropdown is rendered it performs well, but the load on each click is causing the column to be almost unusable.
I've tried overwriting the grid forign key editor template to use virtualization, and while that seems to work initially I do this I get an error with the following text "'ValueMapper is not provided while the value is being set." once a value is set on the grid. We're using 2018.1.117, and from what I read a ValueMapper isn't required, but I could be misinterpreting that.
Do you have any suggestions around how we could get arround this issue?
Hello,
I have been trying to get the value from a simple kendo textbox but keep getting this error: "Unable to get property 'value' of undefined or null reference" upon entry the web page. Below is my jquery and kendo html helper code in my Mvc View:
<script>
function filterGrid() {
var startDate = $("#StartDate").data("kendoDatePicker"),
applType = $("#applTypeDropDownList").data("kendoDropDownList"),
allColumns = $("#allCols").data("kendoTextBox"); <==== problem here
var filter = {
startDate: startDate.value(),
applType: applType.value(),
allColumns: allColumns.value() <==== problem here
};
return filter;
}
</script>
<div class="container-fluid">
<div>
@(Html.Kendo().TextBox()
.Name("allCols")
.Deferred()
)
</div>
</div>
As you can see, I also have other widgets such as datepicker and dropdownlist and they both working fine except the textbox widget.
Please advise. Thank you.
Hello,
I
used Asynchronous Mode of the Upload component in my
MVC project. How to pass small
amount of Json data back to client after successful uploading the file?
Thanks!
I have the following code to dynamically set the height of a Kendo MVC grid. This works on any Windows based browser. However, it does not work in Chrome or Safari on an iOS device. Would you know why this isn't working? Or, is there a better way to change the height of a grid after it's been initialized?
var grid = $("#grid").data("kendoGrid");
$("#grid").css("height", 500);
grid.resize()
grid.redraw();
Hi There,
I've upgraded my ASP.NET MVC website from Kendo 2019 to 2020.1 and suddenly the Kendo.Grid got broken (no data loaded). The first thing I noticed, was the browser error: "Uncaught ReferenceError: getAntiForgery is not defined". (see attached screenshot)
After investigating some hours, I've discovered that I need to remove the .Data("getAntiForgery") call from my View and the [ValidateAntiForgery] attribute from controller actions to be able to resume the Kendo grid functionalities. (see attached screenshots)
Can anybody explain me why?
Thanks,
Alberto
@(Html.Kendo().Grid(Model)
.Name("UserManagement")
.DataSource(dataBinding =>
{
dataBinding.Ajax().Read( read => read.Action("_UserManagement", "Account"))
.Create( create => create.Action( "CreateUser", "Account"))
.Model( model => model.Id( u => u.Id ));
})
.ToolBar(commands =>
{
commands.Create().HtmlAttributes(new { @class = "action pie" });
})
.Columns(column =>
{
column.Bound(c => c.Name).Title(ViewResources.UserManagement.Username.ToUpper());
column.Template(@<
text
></
text
>)
.ClientTemplate( "<
input
type
=
'button'
class
=
'action pie'
value='" + ViewResources.UserManagement.ResetPw +
"'
onclick
=
'onResetPassword( #= Id #, \"#= Name #\" )'
/> " +
"<
input
type
=
'button'
class
=
'action pie'
value='" + ViewResources.UserManagement.Delete +
"'
onclick
=
'onDeleteUser( #= Id #, \"#= Name #\" )'
/>")
.HtmlAttributes(new { style = "text-align: center;" })
.Width(400);
})
.Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
.Pageable()
.Sortable()
.Filterable()
.Events(e => e.DataBound("onDataBound"))
.ClientDetailTemplateId("userRoleLinkTemplate")
)
<
script
id
=
"userRoleLinkTemplate"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
RoleUserLinkModel
>()
.Name("RoleLinks_#=Id#")
.DataSource(dataSource => dataSource.Ajax().Read( read => read.Action( "_UserRoles", "Account", new { userName = "#= Name #" })))
.Columns(column =>
{
column.Bound(r => r.IsLinked)
.Title("")
.ClientTemplate("<
input
type
=
'checkbox'
class
=
'styled'
name
=
'checkedLinks_#= RoleId #_#= UserId #'
onclick
=
'Urv_onCheckChange(#= RoleId #, #= UserId #, this.checked)'
/>")
.Width(36)
.Sortable(false)
.HtmlAttributes(new { style = "text-align:center" })
.Filterable(false);
column.Bound(r => r.RoleName)
.Title(ViewResources.UserManagement.RoleColumn);
})
.Pageable()
.Sortable()
.Filterable()
.Events(e => e
.DataBound("setupStyling"))
.ToClientTemplate()
)
I have a date/time picker in a popup editor that I use javascript to set a default date when the editor opens. The javascript is able to change the value of the date/time picker but the value is not binding to the grid, hence not saving to the server. The record saved will show null for the date field.
How do I set a default date to a date/time picker via javascript and have it bind to the record upon saving?