am happy to announce that we have added a new data control to our Silverlight portfolio with one of our latest internal builds. The control will have its official premiere with the upcoming 2010 Q3 Service Pack 1, which is expected in early January. With the release of this service pack you will get access to all of RadDomainDataSource online examples. Since the first version of RadDomainDataSource is now 100% feature complete and has already passed QA, we have decided that we might as well share it with you as a small Christmas present.
RadDomainDataSource is a Silverlight control that provides the missing link between Telerik Data Controls and WCF RIA Services. Make sure that you are Understanding the WCF in ‘WCF RIA Services’ before you read on.
Up until now, controls like RadGridView, RadDataPager and RadDataFilter did their job solely on the client. You had to write tons of extra code if you wanted to transfer these operations on the server by using the stock DomainDataSource control. Furthermore, things like composite filtering were simply impossible to do with the default DomainDataSource. Now all you need to do is simply bind a Telerik data control to RadDomainDataSource and it will automatically do its job on the server.
When you create a new RIA-enabled Web Application a domain context class is automatically generated in the client project. This domain context is the proxy between the client and the domain service. You could always use this domain context directly and call methods on it to interact with the server. But you will have to handle all the data going back and forth yourself. What RadDomainDataSource offers is to do this job for you automatically. The only two things that RadDomainDataSource needs in order to operate are the domain context and the name of the query method on the server. From then on, RadDomainDataSource will manage all your queries and the data that the server returns. Simply bind RadGridView to RadDomainDataSource.DataView property and you are set.
For those of you who follow the MVVM pattern strictly, we have exposed RadDomainDataSource’s internal view as a public class. It is called QueryableDomainServiceCollectionView<T> and does just what its name suggests – provides a view over a collection of domain service entities. You can use this class directly in your view models. This is the class responsible for all of the heavyweight lifting. In fact, you can think of RadDomainDataSource as just a very thin wrapper over the Queryable Domain Service Collection View which makes it XAML friendly.
Before you ask, I am currently preparing a whole series of blog posts in which I will discuss and explain topics such as:
I will welcome any suggestions for other possible topics that you want me to cover.
I have prepared and attached a very simple project utilizing RadDomainDataSource, RadGridView and RadDataPager. RadDomainDataSource is located in a new assembly called Telerik.Windows.Controls.DomainServices.You can find the licensed version of this assembly in the internal build from the 20th of December. The latest internal build should be available in your Telerik accounts. The project is also using WCF RIA Services V1.0 SP1 Beta. Here is everything that it takes to bind a grid and a pager to the domain data source:
You can use this sample project to play around with the new control and let me know what you think. You can either post a comment here or send me a message on twitter.
Merry Christmas and a Happy New Year to you and your families!
Subscribe to be the first to get our expert-written articles and tutorials for developers!