Hi ,
I've developed a few lines of code with ASP.NET MVC wrappers of Telerik
A Customer Entity with ID , Name , Rate
Entity Framework Code First Context
A Controller with this code :
and a view with this code
when render of view finishes at the end of @HTML.Kendo
I give this exception
Index was out of range. Must be non-negative and less than the size of the collection.
Extra Info
Windows : 8 , Visual Studio Development Server , Visual Studio 2012 , .NET 4.5 , MVC 4 , Kendo UI MVC Wrappers v2012.2.710
thanks for your support
I've developed a few lines of code with ASP.NET MVC wrappers of Telerik
A Customer Entity with ID , Name , Rate
Entity Framework Code First Context
A Controller with this code :
public
ActionResult Index()
{
return
View();
}
public
ActionResult Customers([DataSourceRequest] DataSourceRequest request)
{
var customers = Context.Customers.ToDataSourceResult(request);
return
Json(customers);
}
and a view with this code
@(Html.Kendo().Grid<Customer>()
.Name(
"CustomersGrid"
)
.Columns(columns =>
{
columns.Bound(c => c.ID).Groupable(
false
);
columns.Bound(c => c.FName);
columns.Bound(c => c.LName);
columns.Bound(c => c.Rate);
})
.Groupable()
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource.Ajax().Read(read => read.Action(
"Customers"
,
"Customer"
))
)
)
when render of view finishes at the end of @HTML.Kendo
I give this exception
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Line 19: .Scrollable()
Line 20: .Filterable()
Line 21: .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("Customers", "Customer"))
Line 22: )
Line 23: )
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index] System.ThrowHelper.ThrowArgumentOutOfRangeException() +72 System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +10419142 System.Web.Mvc.ControllerContext.get_RequestContext() +25 Kendo.Mvc.UI.NavigatableExtensions.GenerateUrl(INavigatable navigatable, ViewContext viewContext, IUrlGenerator urlGenerator) +52 Kendo.Mvc.UI.Fluent.CrudOperationBuilder.SetUrl() +81 Kendo.Mvc.UI.Fluent.CrudOperationBuilder.Action(String actionName, String controllerName, Object routeValues) +66 Kendo.Mvc.UI.Fluent.CrudOperationBuilder.Action(String actionName, String controllerName) +47 ASP._Page_Views_Customer_Index_cshtml.<Execute>b__1(CrudOperationBuilder read) in c:\Users\a.rezaei\Desktop\MVCWebApp\MVCWebApp\Views\Customer\Index.cshtml:21 Kendo.Mvc.UI.Fluent.AjaxDataSourceBuilderBase`2.Read(Action`1 configurator) +131 ASP._Page_Views_Customer_Index_cshtml.<Execute>b__0(DataSourceBuilder`1 dataSource) in c:\Users\a.rezaei\Desktop\MVCWebApp\MVCWebApp\Views\Customer\Index.cshtml:21 Kendo.Mvc.UI.Fluent.GridBuilder`1.DataSource(Action`1 configurator) +212 ASP._Page_Views_Customer_Index_cshtml.Execute() in c:\Users\a.rezaei\Desktop\MVCWebApp\MVCWebApp\Views\Customer\Index.cshtml:7
Extra Info
Windows : 8 , Visual Studio Development Server , Visual Studio 2012 , .NET 4.5 , MVC 4 , Kendo UI MVC Wrappers v2012.2.710
thanks for your support