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

RadDomainDataSource and Open Access

11 Answers 120 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 24 May 2011, 05:09 PM

I am trying to use Telerik for my whole project now. and am struggling with getting it to work together.
As i have not found any tutorials or videos that show the process from creating a data model using OpenAccess to displaying and editing it using the RadGrid control.

The issue I am having is to get the RadDomainDataSource to see my service.

I have created my model as well as the domain service.

I can see the code inside my Generated_Code file on the Silverlight client side. So I assume that worked fine.

I have added the following code to my xaml:

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

xmlns:service="clr-namespace:cint.cm.timer.Web"

<telerik:RadDomainDataSource x:Name="myDomainDataSource" QueryName="GetOfficesQuery" AutoLoad="True" PageSize="20">

            <telerik:RadDomainDataSource.DataContext>

                <service:?????????/>

            </telerik:RadDomainDataSource.DataContext>

        </telerik:RadDomainDataSource>

 

Where I put the “????????” is where the error occurs, I do not get the correct service choice there, all I can see is user which is the service that is created with a Silverlight business app.

Not sure, what is wrong here. I have followed the steps in the video tutorial. The only difference is that the tutorial uses standard Entity Model and I use the Open Access Model.

11 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 25 May 2011, 09:53 AM
Hello Andrew,

Can you please take a look at this tutorial.

Kind regards,
Ross
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Andrew
Top achievements
Rank 1
answered on 25 May 2011, 11:13 AM

I tried this tutorial.
It works just fine.
The difference is that the tutorial is using standard RIA domain data source.
I am trying to us the RadDomainDataSource.
I am aware the RAD one is simply based on the normal MS one.
However it does not appear to work for me.

The question still stands, why is the RadDomainDataSource not working here.

0
Rossen Hristov
Telerik team
answered on 26 May 2011, 08:14 AM
Hi Andrew,

To be honest, I think that this is impossible. Your problem is that something went wrong with the client-side code generation (WCF RIA Services and not Telerik) and you are unable to locate your DomainContext. This has nothing to do with whether you use RadDomainDataSource or the stock one. If you take a look at your first post -- your problem is where the "??????" is which is the place where you have to specify the DomainContext. It does not matter whether you will put this DomainContext in a RadDomainDataSource or the stock DomainDataSource. When you don't have a reference to it (for some reason that I do not know) it will not compile with either control. You have to make sure that you can "see" your DomainContext on the client side. This is a problem concerning WCF RIA Services in general and has nothing to do with Telerik.

RadDomainDataSource and the stock DomainDataSource are equivalent and completely interchangeable. 99% of their API is the same. The only property that RDDS does not have is LoadSize (used to pre-fetch entities), but this is irrelevant in this case.

If you have a buildable project with the stock DomainDataSource, you can simply replace it with RadDomainDataSource. That's all. If it was working with the stock DomainDataSource -- it will work with RadDomainDataSource. Please, try it.

If you really think that RadDomainDataSource is not working and the DomainDataSource is working -- can you please send us a simple dummy project with both controls side-by-side which demonstrates how the stock DomainDataSource is working and RadDomainDataSource is not. This will prove that you are right and RadDomainDataSource is not working.

I would like to see how the stock DomainDataSource compiles:

<ms:DomainDataSource x:Name="myMSDomainDataSource" QueryName="GetOfficesQuery" AutoLoad="True" PageSize="20">
 
            <ms:DomainDataSource.DataContext>
 
                <service:?????????/>
 
            </ms:DomainDataSource.DataContext>
 
        </ms:DomainDataSource>

And how RadDomainDataSource does not compile:

<telerik:RadDomainDataSource x:Name="myDomainDataSource" QueryName="GetOfficesQuery" AutoLoad="True" PageSize="20">
 
            <telerik:RadDomainDataSource.DataContext>
 
                <service:?????????/>
 
            </telerik:RadDomainDataSource.DataContext>
 
        </telerik:RadDomainDataSource>

I want both of them on the same page. I would like to see how the yellow thing compiles when placed inside a stock DomainDataSource and how it does not compile when placed inside a RadDomainDataSource.

Both of us know that this is impossible.

Let me know when you prepare such a project.

Thanks in advance.

All the best,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 27 May 2011, 02:38 PM

you say so, and yet it happens.
I have prepared the project and can send it to you.

In the meantime i have found a little bit more. The highlighted area in itself is a little bit misleading.
In both cases the intelisense indicates that there is an error, however when compiling just before the project runs the error disappears.
This is a matter for another question, possibly in another forum.

However the reason i did not know this was the case is that the RadDomainDataSource does not work compared to a classic one.

Here is my code:

<

 

 

telerik:RadDomainDataSource x:Name="myDomainDataSource" QueryName="GetOrganisationsQuery" AutoLoad="True" PageSize="20">

 

 

 

 

<telerik:RadDomainDataSource.DataContext>

 

 

 

 

<service:SofiaCarRentalDomainContext/>

 

 

 

 

</telerik:RadDomainDataSource.DataContext>

 

 

 

 

</telerik:RadDomainDataSource>

 

 

 

 

<riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance service:Organisation, CreateList=true}" Height="0" LoadedData="organisationDomainDataSource_LoadedData" Name="organisationDomainDataSource" QueryName="GetOrganisationsQuery" Width="0">

 

 

 

 

<riaControls:DomainDataSource.DomainContext>

 

 

 

 

<service:SofiaCarRentalDomainContext />

 

 

 

 

</riaControls:DomainDataSource.DomainContext>

 

 

 

 

</riaControls:DomainDataSource>

 


<

 

 

telerik:RadGridView x:Name="testGridView" ItemsSource="{Binding DataView, ElementName=myDomainDataSource}" />

 

 

 

 

<sdk:DataGrid x:Name="organisationDataGrid" ItemsSource="{Binding Data,ElementName=organisationDomainDataSource}"/>

 


And yes i am getting data in the DataGrid that is wired up to the classic DomainDataSource, but no data when tried up to the RadDomainDataSource.
I have already tried uninstalling the telerik tools and reinstalling them.

0
Rossen Hristov
Telerik team
answered on 27 May 2011, 02:54 PM
Hello Andrew,

Can you please send me the project that you have prepared?

All the best,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 27 May 2011, 03:26 PM
Dear Ross,

I have created a support ticket with the project files.
ticket number:  428936

Thanks
0
Rossen Hristov
Telerik team
answered on 27 May 2011, 04:39 PM
Hi Andrew,

Here is what you wrote before...

The issue I am having is to get the RadDomainDataSource to see my service.

Where I put the “????????” is where the error occurs, I do not get the correct service choice there, all I can see is user which is the service that is created with a Silverlight business app.

I downloaded your sample project and opened it. I have attached a video file of what I saw. (Jing is messed up right now, so I have attached it here. You can open it with IE or Chrome).

As you can see from the video, IntelliSense works perfectly inside both controls and the service is successfully found, so I don't see where exactly the problem is?

In fact IntelliSense has nothing to do with controls and such, but I think I have already explained that. You might as well type <service: anywhere on the page and see what IntelliSense will offer you. It should not matter where you type it.

Of course you have to compile your solution for the client side code to be generated by the WCF RIA Services infrastructure and your IntelliSense will immediately start working.

If you have typed "<service:" inside RadDomainDataSource before you have compiled the solution, then you have compiled it (or simply ran it, which will auto-compile it), and then you have typed "<service:" inside the stock DomainDataSource and it worked -- this might have misled you into thinking that RadDomainDataSource has something to do with your IntelliSense problems. And it does not. Is this what you have done, since my video clearly shows that everything is fine with both controls and IntelliSense? I have no other explanation for this.

In case the problem is somewhere else, please describe it as carefully as possible and tell me the exact steps I need to take in order to reproduce it.

Of course, if you want me to be able to run your sample project I will either need your database (it is not in the project) or a sample project with the dummy SofiaCarRental20 database from the online tutorial, since I already have it. 

Thanks in advance. I am looking forward to hearing from you.

Best wishes,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 27 May 2011, 04:54 PM
Dear Ross,

As you can clearly see i have already accepted that the inetl sense on my PC was misleading, and made me look in the worng place for the error.

AGAIN: the error i am experienceing is very simple. And i quote from my previous message:
"i am getting data in the DataGrid that is wired up to the classic DomainDataSource, but no data when tried up to the RadDomainDataSource."

I have provided you with the code, you can recreate the data structure by running the Open Access tool. But i am sure you are more familiar with your own tools then i am.
The only data i have is one row in the organisations table.

If you would like i can make a backup of my own database and send it to you, but it might not work if you are using a different version of sql sever.

Regards

Andrew

0
Rossen Hristov
Telerik team
answered on 27 May 2011, 05:37 PM
Hi Andrew,

I will forward this to the developers in order to test it. I will let you know as soon as we have more info on this subject. I hope that we will know what is going on by tomorrow. Thank you for your involvement.

Best wishes,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Accepted
Rossen Hristov
Telerik team
answered on 27 May 2011, 05:55 PM
Hello Andrew,

I found out what the problem is. The good news is that RadDomainDataSource is not the one to blame here.

You have written DataContext instead of DomainContext:

<telerik:RadDomainDataSource x:Name="myDomainDataSource" QueryName="GetOrganisationsQuery" AutoLoad="True" PageSize="20">
            <telerik:RadDomainDataSource.DataContext>
                <service:SofiaCarRentalDomainContext/>
            </telerik:RadDomainDataSource.DataContext>
        </telerik:RadDomainDataSource>
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance service:Organisation, CreateList=true}" Height="0" LoadedData="organisationDomainDataSource_LoadedData" Name="organisationDomainDataSource" QueryName="GetOrganisationsQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <service:SofiaCarRentalDomainContext />
            </riaControls:DomainDataSource.DomainContext>
Ross
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 27 May 2011, 07:06 PM
Thanks for your help.
I obviously did not follow the webinar carefully enough.
Tags
DomainDataSource
Asked by
Andrew
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or