Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Refresh Datagrid when Datasource is updated

$
0
0
I have a data grid that displays a Table which is bound to a DataSourcewhich keeps changing on a time constraint. 
How to refresh the data grid's content when my DataSource values are updated.

P.S : The values in my DataSource Tables are updated by a monitoring system. Its table values are updated in regular intervals. 

Where should I add my Observable Collection in my EF ?

      
private IQueryable<MyTable> GetMyTablesQuery(TestDBEntities1 testDBEntities1 )
{       
System.Data.Objects.ObjectQuery<EF_demo1.MyTable> myTablesQuery = testDBEntities1.MyTables;
// Returns an ObjectQuery.
return myTablesQuery ;
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
var testDBEntities1 = new EF_demo1.HMDBEntities1();

// Load data into MyTables. You can modify this code as needed.
var eventLogsViewSource =((System.Windows.Data.CollectionViewSource)(this.FindResource("myTablesViewSource")));

IQueryable<EF_demo1.MyTable> myTablesQuery = this.myTablesViewSource(testDBEntities1 );

myTablesViewSource.Source = myTablesQuery .ToList();
}



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>