We’ve supported Server Mode for our controls for some time now and it’s worked, out-of-the-box, for almost any Language-Integrated Query (LINQ) provider. For example the LinqServerModeSource can be used together with our WPF and Windows Forms grids, and the LinqServerModeDataSource can be used with our ASP.NET grid. So far so good. Unfortunately, the LINQ implementation in Entity Framework had some specifics preventing it from building effective dynamic queries for those types that are not known at compile time. Worse, there were Entity Framework specifics which required workarounds which did not work in a medium trust environment.
Well it’s time to fix all that. As of the forthcoming V2010 Vol 2 release, we’ll be providing complete support for Entity Framework in our Data Library. Of course, when I say Entity Framework, I mean EF 4.0 and above – but then you knew that, ‘cos nobody would take a dependency on EF before the 4.0 release, right? There is one limitation though, the maximum number of total or group summaries allowed is 14, but I’m sure you can live with that. 
Okay, enough chit chat, let’s have an example. First thing to do is to create a storage model and mapping information. So, add the ADO.NET Entity Data Model item template and configure it using the Entity Data Model Wizard:

Select “Generate from Database”:

Select the Northwind database:

Select the “Products” table:

And we’re done!

Next, let’s add a grid to our window:
<Window x:Class="DXGrid_EF4_ServerMode.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<dxg:GridControl Name="grid" AutoPopulateColumns="True">
<dxg:GridControl.View>
<dxg:TableView ShowTotalSummary="True" />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Window>
And then bind to the data:
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
NorthwindEntities dataContext = new NorthwindEntities();
grid.DataSource = new LinqServerModeSource() {
ElementType = typeof(Product),
KeyExpression = "ProductID",
QueryableSource = dataContext.Products
};
}
}
For more information oh how Server Mode works, albeit with an OData twist, check out this post.
Oh, and the news just keeps getting better and better. Not only is this technology coming in V2010.2, but there was a beta version released in V2010.1.6, so you can start playing with it now!