This example demonstrates how to use the GridViewExtension.BindToLINQ method to bind the GridView extension to a LINQ to XPO data source.
@Html.DevExpress().GridView(settings => {
settings.Name = "gvDataBindingToLinq";
// ...
}).BindToLINQ(string.Empty, string.Empty, (s, e) => {
e.KeyExpression = "Oid";
DevExpress.Xpo.Session session = XpoHelper.GetNewSession();
DevExpress.Xpo.XPQuery<MyObject> query = new DevExpress.Xpo.XPQuery<MyObject>(session);
e.QueryableSource = query;
}).GetHtml()
(you will be redirected to DevExpress.com to submit your response)