Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ControllerBase.get_ValueProvider()'.
My view(s) include the grid without changes -- and no other portions of the projects have been modified either -- from the project using MVC Preview 2, and the project(s) using MVC 2.0 Beta. I may simply be missing something, but after much investigation, I'm wondering if this is being caused by the MVC framework changes from preview to beta, or with the MVC extensions, or by some oversight on my part elsewhere in my project. I'm using the grid in my view(s) with the following configuration:
<% Html.Telerik().Grid(Model)
.Name("Customers")
.PrefixUrlParameters(false)
.Columns(columns => {
columns.Add(c => c.Id);
columns.Add(c => c.CompanyName);
columns.Add(c => c.FirstName);
columns.Add(c => c.LastName);
columns.Add(c => c.Email);
columns.Add(c => c.Phone);
columns.Add(c => c.CreatedOn);
})
.Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
.Pageable(paging => paging.PageSize(10)
.Style(GridPagerStyles.NextPreviousAndNumeric)
.Position(GridPagerPosition.Bottom))
.Scrollable(scrolling => scrolling.Height(250))
.Render(); %>
Anyone else run into this exception, or can point me in the direction of some error I'm overlooking elsewhere?
Thanks,
Scott Wade
28 Answers, 1 is accepted
Telerik.Web.Mvc.UI.IGridBindingContext.get_ValueProvider()
GridBindingContextExtensions still contains the following method signature with the IDictionary<string, ValueProviderResult> valueProvider, parameter:
public static T ValueOf<T>(this IDictionary<string, ValueProviderResult> valueProvider, string key);
If I'm correct, I suspect waiting for the next build of the Extensions (Telerik.Web.Mvc) will address the problem?
Here's the breaking change (from the release notes for MVC 2.0 Beta) and the Grid usage and full stack trace from a stripped-down and simplified test project below it:
Changes in ASP.NET MVC 2 Beta
Introduced the IValueProvider interface, which replaces all usages of IDictionary<string, ValueProviderResult>.
Every property or method argument that accepted IDictionary<string, ValueProviderResult> now accepts IValueProvider. This change affects only applications that include custom value providers or custom model binders.
Examples of properties and methods that are affected by this change include the following:
· The ValueProvider property of the ControllerBase and ModelBindingContext classes.
<% Html.Telerik().Grid<InMemoryCustomer>()
.Name("MyGrid")
.Columns(
columns =>
{
columns.Add(c => c.Id);
columns.Add(c => c.Name);
columns.Add(c => c.Address);
columns.Add(c => c.RegisterAt).Format("{0:MM/dd/yyyy}");
columns.Add(c => c.IsActive);
}
)
.BindTo(Model)
.Render(); %>
StackTrace:
at Telerik.Web.Mvc.UI.Grid`1.Telerik.Web.Mvc.UI.IGridBindingContext.get_ValueProvider()
at Telerik.Web.Mvc.UI.GridBindingContextExtensions.ValueOf[T](IGridBindingContext context, String key)
at Telerik.Web.Mvc.UI.GridDataProcessor.get_CurrentPage()
at Telerik.Web.Mvc.UI.GridDataProcessor.EnsureDataSourceIsProcessed()
at Telerik.Web.Mvc.UI.GridDataProcessor.get_ProcessedDataSource()
at Telerik.Web.Mvc.UI.Grid`1.WriteRows(IGridRenderer`1 renderer)
at Telerik.Web.Mvc.UI.Grid`1.WriteTable(IGridRenderer`1 renderer)
at Telerik.Web.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer)
at Telerik.Web.Mvc.UI.ViewComponentBase.Render()
at Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render()
at ASP.[MY VIEW FILE NAME]_aspx.__Render[MY VIEW]Content(HtmlTextWriter __w, Control parameterContainer) in [MY VIEW FILE LOCATION\MY VIEW FILE NAME]:line 20
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in [MY PROJECT LOCATION]\\Web\\Views\\Shared\\Site.Master:line 36
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The ASP.NET MVC2 has breakaing changes with ASP.NET MVC1 which means our extensions are not compatiable with the MVC2. We hope that once the MVC2 hits the RC, we will provide an MVC2 specific version with the existing features.
Regards,
Kazi Manzur Rashid
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The MVC Extensions are really great work from you guys...and I look forward to working with it further as it evolves! Some really helpful blog posts have been coming out as well...keep 'em coming, and thank again. Here's the bummer among all the great news and bits that came out of PDC last week, IMHO:
"Note: Because Visual Studio 2008 and Visual Studio 2010 Beta 2 share a component of ASP.NET MVC, installing ASP.NET MVC 2 Beta on a computer where Visual Studio 2010 Beta 2 is also installed is not supported."
From our next release we are planning to include two separate binaries for each version." Looking forward to it!
We are currently working on MVC2 support. Once we are ready with the build I will update this forum thread.
Regards,
Atanas Korchev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
On the other hand, Telerik team, the labling of the project is not clear. The versions of MVC that the release has been tested and found compatible with should be at least be specified on the download page.
Cheers
Matt
Absolutely, sorry for my mis-guided.
Telerik extension is so excellent that I can't find the same thing in other place!
it's just M$ changed 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ControllerBase.get_ValueProvider()'.
It's great if there is a quick tuning. :)
Thanks~
Will
Also, what is the difference between the Extensions for ASP.NET MVC - Open Source, and the Extensions for ASP.NET MVC, such that they are listed as two different products and downloads? If the same, would contributions from the community to the source for the Extensions be helpful or accepted? I'd be willing to volunteer some of my time to the project and help get the product closer to MVC 2 support, and know other developers that would be interested as well, if that is appropriate?
Anyway, love the work you guys are doing, and am anxiously awaiting any announcements from Atanas Korchev or others on the team regarding a new build! Thank you for your hard work!
I am glad to announce that we just released our MVC2 compatible bits. Please check my blog post for additional info.
@Scott
You can check the following pages for the differences between the commercial and the open source version.
http://www.telerik.com/purchase/faqs/aspnet-mvc.aspx
http://telerikwatch.com/2009/11/telerik-extensions-for-mvc-unofficial.html
We are currently not accepting patches from the community because we still don't have the required license agreement (so we can use your code in our commercial distribution). We will post an update once we do.
Regards,
Atanas Korchev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You are super!!!!
I can't wait to download and try~
The layout bug will be resolved if you set the Width of each column and enable .Scrolling(). There simply isn't enough space for the data.
I also happened to notice that the filtering icons aren't high enough to cover the whole row - you can adjust that by adding vertical padding to them, using the following style:
.t-grid .t-grid-filter
{
padding-top: 0.6em;
padding-bottom: 0.6em;
}
Also, you can set the Filterable() and Sortable() properties on the select and details columns to false, since they do not convey any meaningful data that can be filtered or sorted.
All the best,
Alex
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Phil's recent post [ http://haacked.com/archive/2009/12/19/aspnetmvc-2-and-vs2010.aspx ] clarified the roadmap for releases of the MVC 2 bits as well as the tooling for VS 2010 and VS 2008... and I'm wondering if documentation and examples for the extensions will simply be updated closer that time, or if any of the Extension builds between this latest and those forthcoming will include updated documentation? For now, diving into source code can be done to illuminate changes in the API...
Thanks again for all you efforts, and BTW, thanks for supporting DotNetRocks and other podcasts as a company. Any plans for a Telerik Podcast? I think it would be great and an invaluable service to go along with the other material available on the telerik website, like Telerik TV!
The documentation has already been updated but still not uploaded online. However there are no changes in the API of the Telerik MVC Extensions - this means you can use them in the same way as with ASP.NET MVC 1. The sole change which was made is in the implementation of the grid. Namely the type of the ValueProvider property was updated in MVC2 which made the MVC1 buld incompatible. Examples will be updated when we implement MVC 2 specific features - grid editing and client-side validation which is most likely to happen when we release officially our next version - Q1 2010 expected in the beginning of March. Once ASP.NET MVC 2 goes official we will release another update as well.
As for a Telerik podcast - stay tuned. There might be some development in that direction.
Regards,
Atanas Korchev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
dave
| <%= Html.Telerik().Grid<SmsMessageOutboundModel>(Model) |
| .Name("Grid") |
| .Columns(columns => |
| { |
| columns.Add(o => o.SendDate).Width(100); |
| columns.Add(o => o.Body).Width(200); |
| columns.Add(o => o.SentDate).Format("{0:MM/dd/yyyy}").Width(120); |
| }) |
You are not using the MVC2 dll. Please check my blog post for additional details.
Regards,
Atanas Korchev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
View:
<%= Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.windows7.css"))
%>
<%= Html.Telerik().Grid<TimeSlot>()
.Name("Grid")
.Columns(columns =>
{
columns.Add(o => o.Id).Width(100);
columns.Add(o => o.Time).Format("{0:hh:mm}").Width(120); ;
columns.Add(o => o.Day);
})
.Ajax(ajax => ajax.Action("_ClientSideEvents_Ajax", "Home"))
%>
<%Html.Telerik().ScriptRegistrar().jQuery(false).Render(); %>
Controller:
[GridAction]
public ActionResult _ClientSideEvents_Ajax()
{
return View(new GridModel<TimeSlot>
{
Data = GetTimeSlots()
});
}
private IEnumerable<TimeSlot> GetTimeSlots()
{
List<TimeSlot> data = new List<TimeSlot>();
data.Add(new TimeSlot() { Id = 1, Day = DayOfWeek.Sunday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 2, Day = DayOfWeek.Monday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 3, Day = DayOfWeek.Tuesday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 4, Day = DayOfWeek.Wednesday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 5, Day = DayOfWeek.Thursday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 6, Day = DayOfWeek.Friday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
data.Add(new TimeSlot() { Id = 7, Day = DayOfWeek.Saturday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
return data;
}
The version of ASP.NET MVC 2.0 you are using looks to be the issue. Even though you mention that you have verified you are using ASP.NET MVC 2.0 files, it looks like you are using something prior to ASP.NET MVC 2.0 Beta. Any MVC 2.0 prior to that will cause the error you have presented, as the method causing you the error, no longer exists with that signature. Only MVC 2.0 prior to the Beta or newer still uses the IDictionary<string, ValueProviderResult> interface...
I would suggest downloading the latest MVC 2.0 Release Candidate, here: http://www.microsoft.com/downloads/details.aspx?FamilyID=3b537c55-0948-4e6a-bf8c-aa1a78878da0&displaylang=en , and trying your proof-of-concept again.
From the release notes:
Changes in ASP.NET MVC 2 Beta
Introduced the IValueProvider interface, which replaces all usages of IDictionary<string, ValueProviderResult>.
Jesse
--Scott Wade--
Server Error in '/' Application.
Method not found: 'System.Web.Mvc.IValueProvider System.Web.Mvc.ControllerBase.get_ValueProvider()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.MissingMethodException: Method not found: 'System.Web.Mvc.IValueProvider System.Web.Mvc.ControllerBase.get_ValueProvider()'.
Source Error:
|
You should use the MVC1 version if your project is MVC1. This exception will be thrown if you are using a different version. Check the last number of the assembly version of Telerik.Web.Mvc.dll. If it is 135 then you are using the MVC1 build. If it is 235 then you are using the MVC2 build.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.