raddomaindatasource does not find domain context

2 posts, 0 answers
  1. tony
    tony avatar
    49 posts
    Member since:
    Nov 2006

    Posted 19 Jun 2012 Link to this post

    i may have a minor bug - visual studio reports that my domain context is not found but runs the code as expected. it may be cosmetic or an accident waiting to happen.

    i created RadDomainDataSource
    <telerik:RadDomainDataSource x:Name="CustomerPurchasesDomainDataSource"
                                                 QueryName="GetItems"
                                                 AutoLoad="True"
                                                 PageSize="10">
            <telerik:RadDomainDataSource.DomainContext>
                   <service:CustomerDomainContext></service:CustomerDomainContext>
            </telerik:RadDomainDataSource.DomainContext>
    </telerik:RadDomainDataSource>

    i added the xmlns entries:
    xmlns:service="clr-namespace:CustomerSite.Web.Services"

    i ran the code and get my data in a grid. when i use the corresponding microsoft controls - domaindatasource and grid - i do not get an error for a missing domain context.

    this is in vs2012rc so you may not even consider this a valid defect and it may be microsoft's problem but i am not sure why telerik controls would generate the message but microsoft controls would not.
  2. tony
    tony avatar
    49 posts
    Member since:
    Nov 2006

    Posted 19 Jun 2012 Link to this post

    it turns out that this is a cosmetic defect. the solution is to annotate the custom method as [Query] and annotate one of the custom class properties as [Key]. this will eliminate the error message.

    however, the error is being reported against the domaincontext when it should be reported against the QueryName.

    to verify, i used corresponding microsoft controls. vs reported the problem with the query rather than with the domaincontext which helped me figure out the real problem and solution. not sure if there is something in telerik code which directs the source of the error. if so, it should point to the query rather than the domain context.

    i hope that this explanation will help anyone else encountering this problem.
  3. DevCraft banner
Back to Top