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

raddomaindatasource does not find domain context

1 Answer 63 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
tony
Top achievements
Rank 1
tony asked on 19 Jun 2012, 05:03 AM
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.

1 Answer, 1 is accepted

Sort by
0
tony
Top achievements
Rank 1
answered on 19 Jun 2012, 09:09 PM
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.
Tags
DomainDataSource
Asked by
tony
Top achievements
Rank 1
Answers by
tony
Top achievements
Rank 1
Share this question
or