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

ObjectDataSource with static class

1 Answer 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
chris_cf
Top achievements
Rank 2
chris_cf asked on 22 Sep 2011, 05:34 AM
Hi,

I have a static class that I would like to use with ObjectDataSource. However, the class does not show up in the report wizard.

How do I get it to show up?

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 26 Sep 2011, 04:53 PM
Hi Chris_Cf,

The reason you do not see your class is because the ITypeDiscoveryService filters out all static classes from the collection of returned types. Since the service is a part of the standard Visual Studio design-time support, it is beyond our reach to alter this behavior. The only workaround we have found so far is to remove the 'static' keyword from the declaration of your class. You can still prevent instantiating the class by accident in code if you define a private constructor.

Hope this helps.

Best wishes,
Ivan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
chris_cf
Top achievements
Rank 2
Answers by
Ivan
Telerik team
Share this question
or