Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9098327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:20:15+00:00 2026-06-17T00:20:15+00:00

I have a data grid that displays a Table which is bound to a

  • 0

I have a data grid that displays a Table which is bound to a DataSource which keeps changing on a time constraint.
How to refresh the data grid’s content when myDataSource 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 )
    {
         // definition of a Query to retrieve the info from my DB
        System.Data.Objects.ObjectQuery<EF_demo1.MyTable> myTablesQuery = testDBEntities1.MyTables;
         // Returns an ObjectQuery.
        return myTablesQuery ;
    }

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
         // A New entity container is created that uses the object context
        var testDBEntities1 = new EF_demo1.HMDBEntities1();
         // Load data into MyTables. 
        var myTablesViewSource= ((System.Windows.Data.CollectionViewSource)(this.FindResource("myTablesViewSource")));
         // the query which is defined above is executed here. It grabs all the information from the entity container
        IQueryable<EF_demo1.MyTable> myTablesQuery = this.GetMyTablesQuery(testDBEntities1 );
         //The query result is binded to the source of the myTablesViewSource, which inturn binds back to the list.
        myTablesViewSource.Source = myTablesQuery .ToList();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:20:16+00:00Added an answer on June 17, 2026 at 12:20 am

    One possible way is to use an ObservableCollection:

    BoundCollection = new ObservableCollection<MyEntityType>(entities);
    

    Where BoundCollection is used in your binding. And then whenever the values are updated, you would clear the collection and re-add them:

    BoundCollection.Clear();
    foreach(var e in entities)
    {
        BoundCollection.Add(e);
    }
    

    Here’s another option that uses INotifyPropertyChanged and rebinds the collection each time. However, using an ObservableCollection is the preferred method as its is designed for adding and removing items which will automatically update the UI.

    public class MyModel : INotifyPropertyChanged
    {
      public IList<MyEntity> BoundCollection {get; private set;}
    
      public MyModel()
      {
        UpdateBinding();
      }
    
      private void UpdateBinding()
      {
        // get entities
        BoundCollection = new List<MyEntity>(entities);
        // this notifies the bound grid that the binding has changed
        // and should refresh the data
        NotifyPropertyChanged("UpdateBinding");
      }
    
      public event PropertyChangedEventHandler PropertyChanged;
    
      private void NotifyPropertyChanged( string propertyName = "")
      {
        if (PropertyChanged != null)
        {
          PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which displays some grid data for search results...Now the height
I have a datagrid that displays a table which is bound to a SQL
I have a table in which one column (type ntext) has data that includes
I have a DataGrid component that displays a few columns of data. It has
I have a Silverlight DataGrid that contains a single template column which displays a
I have a datagrid that displays a table from a database as follows :
I have a Form in my application that displays some data. When I first
I have an application that uses data queries and displays them in a UITableView.
I have created a datagrid which displays a Table of records populating from a
I have a grid view which pulls through data dictated by a stored procedure.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.