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

Domain Service Context Object visible but does not compile.

3 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Moni
Top achievements
Rank 1
Moni asked on 16 Jul 2010, 12:10 AM
Hi there,
Beginner's pains - any help appreciated.
I followed the instructions towards creating a sample project with a GridView (Pg. 725; RadControlsSilverlightCourseware.PDF"
Got stuck on point #7 - creating the context object.
I did put a reference <using SilverlightApplication1.Web;>
Problem is - when I declare

DomainService1Context context =

 

new DomainService1Context();

 

I can see intellisense picking the name of the domain service context object but after compilation I get "Error 1 The type or namespace name 'DomainService1Context' could not be found (are you missing a using directive or an assembly reference?) C:\Users\tempdev\documents\visual studio 2010\Projects\SilverlightApplication1\SilverlightApplication1\MainPage.xaml.cs 22 13 SilverlightApplication1
"
You can see the attached screen-shot.
Indeed I am not using the names as mentioned in the PDF but otherwise I did follow the instructions.
I seem to be missing something really simple in my environment.
Any help is appreciated
Best to all

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 16 Jul 2010, 07:21 AM
Hi Moni,

I am not sure what is going on in your project, but you can try the code-less binding approach:

<riaControls:DomainDataSource x:Name="DomainDataSource1" FilterOperator="Or" AutoLoad="True" QueryName="GetCustomers" PageSize="10" LoadedData="DomainDataSource1_LoadedData">
            <riaControls:DomainDataSource.DomainContext>
                <e:NorthwindDomainContext />
            </riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
         
<telerik:RadGridView x:Name="RadGridView1"
   ItemsSource="{Binding Data, ElementName=DomainDataSource1}"
   IsBusy="{Binding IsBusy, ElementName=DomainDataSource1}" />
 
<telerik:RadDataPager x:Name="RadDataPager1"
   Source="{Binding Data, ElementName=DomainDataSource1}" />

Hope this will get you started.

Greetings,
Veskoni
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
Moni
Top achievements
Rank 1
answered on 16 Jul 2010, 04:34 PM
Hey - thanks for the quick reply.
I could not try it.
Problem is with my environment.
SL4 kills projects written in SL3
I had VS2008 + SL3
Now I had to upgrade to VS2010 Ultimate + SL4
Projects written 5 months ago would not run now under the new setup.
I wonder what a .... approves those releases at Microsoft which result in a major re-write every 6 months ...

Under VS2010 I don't even know what project template to start so I can plop a single Rad GridView on an empty page.
Under VS2008 Web developer - it used to be the template for Silverlight Business Application - It seems this is no longer the case.

If you have any suggestions about which template to use under VS2010 - that could be helpful.

P.S. these are the breaking changes for SL4
http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=RiaServices&DownloadId=8313

0
Moni
Top achievements
Rank 1
answered on 17 Jul 2010, 01:12 AM
Huh ... solved.

It takes about 45 sec to get it all done ... and you do not need to touch the keyboard:
For SL 4 + VS2010 this is the summary
Try this by accepting the default names:
1. New Silverlight Business Project
2. R-click on BusinessApplication.Web
3. Add-New-Data Template - ADO.NET Entity Data Model
4. Add one and point to only ONE SMALL table/view
If you pick a big one you will get to read this post:
http://forums.silverlight.net/forums/p/184364/420574.aspx
5. R-click on BusinessApplication.Web
6. Add-New-Web Template - Domain Service Class
Make sure you click the table + Enable Editing + Generate Associated Classes + Enable Client Access
7. Go to Main Page XAML - It will open by default in a split screen; Top is Design, Bottom is code
8. Drag & drop a Telerik Grid View on the main page. !! Stretch it to see the data area as well !!
9. !!! Click on the grid object in the design window to put it in focus - otherwise you will not see the data sources.
10. Expand on the left the section with Data Sources (or go to the tool-bar - DATA - Show Data Sources)
11. Take your table from there and drag-drop over the Telerik GridView - it should recognize the data and format the columns.
12. Run
13. If I did not miss anything above (typing in a hurry) you will see your data.

And here there is a link for details.
http://www.silverlight.net/learn/videos/all/ria-services-support-visual-studio-2010/
Tags
GridView
Asked by
Moni
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Moni
Top achievements
Rank 1
Share this question
or