I'm using Kendo UI grid on one of my page.
I want to show all users in grid using membership object.
@model IEnumerable<MembershipUser>
@(Html.Kendo().Grid(Model)
.Name("Gridusers")
.Columns(columns =>
{
columns.Bound(o => o.UserName).Width(100);
})
.Sortable()
.Filterable(filtering => filtering.Enabled(true)))
When I come to this page after getting list of users from controller it is giving error
"No parameterless constructor defined for this object."
It is working fine when I'm using the old Telerik MVC grid but not with Kendo UI grid.
Can any one help me?
The Kendo UI grid needs the bound model to have a parameterless constructor because it instantiates an instance of it. In your case you could add an empty constructor to the MembershipUser
class:
public class MembershipUser
{
public MembershipUser()
{
}
/* other methods */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With