public MainWindow() { InitializeComponent(); var source = new ODataVirtualDataSource() { BaseUri = "http://services.odata.org/V4/Northwind/Northwind.svc", EntitySet = "Orders", PageSizeRequested = 200 }; //source.DeferAutoRefresh = true; source.SchemaChanged += Source_SchemaChanged; source.SortDescriptions.Add(new SortDescription("ShipName", ListSortDirection.Descending)); source.FilterExpressions.Add( FilterFactory.Build((f) => { return f.Property("ShipName").ToUpper().IsLessThan("G") .Or(f.Property("ShipName").ToUpper().IsGreaterThan("U")); })); grid1.ItemsSource = source; //Task.Delay(10000).ContinueWith((t) => //{ // Dispatcher.BeginInvoke(new Action(() => // { // source.DeferAutoRefresh = false; // })); //}); }
public MainWindow() { InitializeComponent(); var source = new ODataVirtualDataSource() { BaseUri = "http://services.odata.org/V4/Northwind/Northwind.svc", EntitySet = "Orders", PageSizeRequested = 200 }; //source.DeferAutoRefresh = true; source.SchemaChanged += Source_SchemaChanged; source.SortDescriptions.Add(new SortDescription("ShipName", ListSortDirection.Descending)); grid1.SelectionMode = GridSelectionMode.SingleRow; grid1.ItemsSource = source; //grid1.SelectedItemsChanged += Grid1_SelectedItemsChanged; //Task.Delay(10000).ContinueWith((t) => //{ // Dispatcher.BeginInvoke(new Action(() => // { // source.DeferAutoRefresh = false; // })); //}); }