This is a migrated thread and some comments may be shown as answers.

TypeBuilder

1 Answer 41 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 2
B asked on 26 Jan 2016, 04:30 PM

When I use TypeBuilder to create public properties like:

 

PropertyBuilder property =
   typeBuilder.DefineProperty(propertyName,
                     PropertyAttributes.None,
                     pType,
                     null);

These are not recognized by PivotGrid, eventhough I make them public:

MethodAttributes GetSetAttr =
     MethodAttributes.Public |
     MethodAttributes.HideBySig;
 
// Define the "get" accessor method for current private field.
MethodBuilder currGetPropMthdBldr =
    typeBuilder.DefineMethod("get_value",
                               GetSetAttr,
                               pType,
                               Type.EmptyTypes);

For example mouse over in Visual Studio does show them as public properties, so I would expect the PivotGrid to see them as well?

Is there a way to make PivotGrid see those dynamic properties?

Regards,

Bayram

1 Answer, 1 is accepted

Sort by
0
B
Top achievements
Rank 2
answered on 27 Jan 2016, 01:26 PM

Ok I fixed it by letting the dynamic base class implement ICustomTypeProvider and then returning this.GetType()

 

Tags
PivotGrid
Asked by
B
Top achievements
Rank 2
Answers by
B
Top achievements
Rank 2
Share this question
or