magritton
6/19/2014 - 7:04 PM

This will change the data source on a dev express data grid at run time with a SQL LINQ data source

This will change the data source on a dev express data grid at run time with a SQL LINQ data source

protected void LinqServerModeDataSource1_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e)
{
	IQueryable iWF;
	LinqSQLDataDataContext context = new LinqSQLDataDataContext();

	iWF = (from l in context.vw_Sales_MTD_Product_Regions
		   where l.SALES_REGION == "LATIN AMERICA-L BARRIGA"
		   orderby l.Sales descending
		   select l).Take(50);
	e.QueryableSource = iWF;
                       
}