Sunday, January 17, 2010

Where is context.LoadProduct() in Silverlight 3 and RIA Serivce?

If you downloaded Microsoft .NET RIA Services Overview, MIX 2009 Preview, and run the first overview example, which simply displays Products in the siverlight DataGrid, you may disappoint with the fact that you can't run the sample example.

The problem is that datagrid does not populate product data, and just shows headers.

Update the example code with following snippet:



public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
var context = new ProductContext();

grdProducts.ItemsSource = context.Products;
context.Load(context.GetProductQuery());
}
}

No comments:

Post a Comment