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

  • SEARCH
  • Home
  • 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 5849377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:59:27+00:00 2026-05-22T12:59:27+00:00

I feel like I’m missing something here, but I have this datagrid which when

  • 0

I feel like I’m missing something here, but I have this datagrid which when the datasource changes, automatically redraws it self with no logical reason for it doing so.

I have the datagrid bound to a DataView property which implements INotifyPropertyChanged and I want to do some other stuff when that event is fired before calling Refresh().

So here is the datasource.

public class MainScreenDataView : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
    void OnPropertyChanged(string name)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(name));
        }
    }

    DataView _dataview;

    public DataView GetDataView
    {
        get { return _dataview; }
        set
        {
            _dataview = value;
            OnPropertyChanged("GetDataView");
        }
    }
    public MainScreenDataView()
    {
    }
}

And the binding (I call this in the constructor of the window)

    public void MakeData()
    {
        MiddleMan midman = MiddleMan.Instance; 
        midman.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(midman_PropertyChanged); //unrelated event for error messages
        midman.InstantiateAll();


        Binding bind = new Binding();
        bind.Source = midman.GetDict["contact"].GetDataView; //GetDict is a dictionary that holds instances of MainScreenDataView
        bind.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
        DG_Contacts.SetBinding(BetterDataGrid.ItemsSourceProperty, bind);
    }

The class that updates the DataView with data from a database has access to that same instance of MainScreenDataView as the window. The instance is kept in a dictionary in a singleton.

Now I see no reason why the datagrid would refresh it self, I even tried removing the INotifyPropertyChanged stuff from MainScreenDataview and yet it keeps the same behavior.

Guess there’s something I’m missing here. Default behavior somewhere that needs to be overridden or something?

  • 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-05-22T12:59:28+00:00Added an answer on May 22, 2026 at 12:59 pm

    You’ve got target and source swapped. Done it myself. The UpdateSourceTrigger.Explicit setting affects how the binding updates the source which is the MainScreenDataView.GetDataView property not the DataGrid.ItemSource. The DataGrid.ItemSource is the target.

    Removing INotifyPropertyChanged from MainScreenDataView will have no effect on a singleton because the instance doesn’t change, only the values inside the instance. In other words, GetDataView is a “set it and forget it” property.

    As long as the binding is in effect, there is no way to prevent changes made to the collection from being propagated by the binding system unless you suppress DataView.CollectionChanged events from firing or block so that the binding subsystem simply doesn’t run.

    If you really want this you can disconnect the binding and set it again when you are ready or create an entirely new DataView and overwrite the binding when you are ready.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like this is a dumb question and I'm missing something, but I
I feel like I'm missing something very simple here. I have Eclipse set up
Feel like this should be something easy that I'm missing. I have a table
I feel like I'm missing something simple here (as usual). I'm trying to read
I feel like a bit of a newbie posting this, but anyway: I have
I feel like this should have a simple answer, but I can't find it.
I feel like I'm missing an obvious point here, but let's say I'm working
I feel like I am missing something easy or stupid. This is the only
I feel like I'm missing something obvious... but does firebug interfere with cookie deletion?
I feel like a fool, but here goes: public interface IHasErrorController{ ErrorController ErrorController {

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.