1

Here is the Property in the Base Class

[ReadOnly(true), Display(GroupName = "Payment Details")]
public virtual GridViewModel<PaymentDetails> Details { get; set; } 

Here is the Property in the Inherited Class

[Display(AutoGenerateField = false, AutoGenerateFilter = false), ScaffoldColumn(false)]
public override GridViewModel<PaymentDetails> Details { get; set; } 

I get Method may only be called on a Type for which Type.IsGenericParameter is true. error Here is a piece of the Call Stack

[InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.]
   System.RuntimeType.get_DeclaringMethod() +9546416

[TargetInvocationException: Property accessor 'DeclaringMethod' on object 'System.RuntimeType' threw the following exception:'Method may only be called on a Type for which Type.IsGenericParameter is true.']
   System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +400
   System.Web.Mvc.<>c__DisplayClassb.<GetPropertyValueAccessor>b__a() +18
   System.Web.Mvc.ModelMetadata.get_Model() +19
   System.Web.Mvc.TemplateInfo.Visited(ModelMetadata metadata) +69
1
  • 2
    Please provide a short but complete example demonstrating the problem.
    – Jon Skeet
    Apr 16, 2012 at 17:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.