Aug 29, 2013 at 1:42 PM
Edited Aug 29, 2013 at 2:14 PM
I got the following exception when try to get Grid.Mvc working in my solution:
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
I managed to integrate Grid.Mvc lately on another project, without any problem. The only difference between those 2 projects is that the current one is using .NET framework 4.5 as target framework. Does Grid.Mvc work under 4.5?
Here is the part of the exception stack trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +14460247
GridMvc.Html.GridHtmlOptions`1.RenderPartialViewToString(String viewName, Object model, ViewContext viewContext) +221
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +17
Here is the Grid implementation on the view:
columns.Add(o => o.Id).Sortable(true);
columns.Add(o => o.Name).Sortable(true);
where Model is IQueryable<ViewModel>
I'm pretty sure that my implementation is correct, since i followed the Documentation and i already implemented this grid on previous project successfully.
Grid.Mvc version is 2.3.0 installed within NuGet package manager.
Do you have any idea what might be the problem?
Let me know if you need more details.
Thanks in advance.