ObjectDataSource with static class

2 posts, 0 answers
  1. chris_cf
    chris_cf avatar
    53 posts
    Member since:
    Jul 2007

    Posted 22 Sep 2011 Link to this post


    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?
  2. Ivan
    Ivan avatar
    114 posts

    Posted 26 Sep 2011 Link to this post

    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,
    the Telerik team

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

Back to Top