The roadmap for DevExpress 2011 is launched. In the roadmap you see that Silverlight will get much more attention. WinForms is and old technology that they probably will let go in future releases. Many users write in the comments that they want to see more attention to WinForms then Silverlight because Silverlight is not “Business Ready”. I think that DevExpress has some more inside news in the Roadmap of Microsoft. I also think that Microsoft wont work on new features for WinForms anymore.
Silverlight is the future and I think that Silverlight will get more attention by Microsoft then WPF (Windows Presentation Foundation) in the future. New news about WPF is not really coming out that often and will not get that much attention as the new features in Silverlight. Silverlight 5 is coming out at the end of 2011. If you think about it, that is a very long time for a release in Silverlight versions. Silverlight 1, 2, 3 and 4 where coming out after about 9 months after each other. Silverlight 4 was released in April of 2010 so the end of 2011 is a lot longer then 9 months! My philosophy is that Microsoft will create Silverlight 5 for Desktop and Windows Phone 7 in one time. They already said that Phone 7 will get a big release at the end of the year and that the new Internet Explorer 9 will be coming this year to Phone 7 including a new version of Silverlight.
So, not so crazy that a company as DevExpress will put that much effort in creating controls for Silverlight and not for WinForms!
If you want to see the roadmap of 2011 for the DevExpress controls, you can find it here.
If you want to have a master detail view of you data in Silverlight with RIA Services you have to do two things. One thing is to tell your RIA Services meta data file that you’re including the related entities and you will have to tell your domain service as well that your including the related entities. Follow the tutorial beneath to accomplish an example for creating a master detail relation with Silverlight RIA Services.
Create a new Silverlight 4 application in VS2010 and enable RIA Services. Also don’t forget to check the box to host your Silverlight application in a website.
Create your Entity Framework 4.0 model so we can generate some RIA Service over it. Just use a simple example so we can practice the master detail relationships. The example that I use is shown below.
After your model is created we have to create the Domain Service that exposes your model from the server to the client. If you haven’t used RIA Services before, I suggested you should read the documentation on the http://www.silverlight.net homepage.
Select add new item on your server website. The same place as you created your Entity Framework model. Now search for the Domain Service template. After you clicked the OK button, you will get a popup that is asking you to specify which entity the domain service should expose from your Entity Framework model. Click the Brands and Product collections, select the checkbox to generate meta data files and to enable client access.
Creating the UI
Open your MainPage.xaml file that is generated by creating the Silverlight Application. Open your Data Sources window in VS2010 and drag the Brands and Products grids to your MainPage. You have to drag your Products from the inner collection of Brands.
Now if you run your code. Only the brands will be shown because the UI is connected to the GetBrandsQuery. Now we want to include the products to create a Master Detail relation.
Configure the Meta data
Open your meta data file that is generated by the Domain Service. Find your Brands Entity and in that entity the inner collection property of Products. Add the [Include] attribute above the inner collection of products. In that way we tell RIA Services to include the products for the brand if the products are available.
Make the products available
To make the products available for RIA Services you should include them in the correct query that is used in the client. In our case it is the GetBrands in the Domain Service class.
Add the include statement like below to the query.
Now you are ready to run your code and see a nice example of a master detail relationship in the client.
It is better to create a new query then change the default query. In that way the performance is better because you don’t need the products every time you use the GetBrands query. You can create a query like GetBrandsWithProducts. If you do this, don’t forget to change the query name in the client. This is still referenced to the GetBrands query!!!