Search code examples
bindingdatagridrefreshcaliburn.microrowdetails

Caliburn Micro Update RowDetails of a Datagrid


Let me explain my problem. I am working with Caliburn Micro and have a datagrid where a ObservableCollection is being binded as an Itemsource:

private static ObservableCollection<Models.GamesProperties> _dgGames;

public ObservableCollection<Models.GamesProperties> DgGames
{
    get { return _dgGames; }
    set
    {
        _dgGames = value;
        NotifyOfPropertyChange(() => DgGames);
    }
}

So, when I load my data from my database, the collection will be filled and binded to my datagrid (called DgGames)

Everything is fine so far. I have defined for each DataRow "DataRowDetails". Contains an ImageSource, some TextBlocks and so on. The mentioned collection above contains also those DataRowDetails.

I have now created another View and ViewModel for a dialog window in order to change the DataRowDetails. It does work, but the datagrid (DgGames) won't apply these changes. It does not show any update i have done to the collection. What am I missing ?

Thanks in advance to those who can help me.

If you need more information, feel free to ask.


Solution

  • In order to see modification on the fly in the grid too, Models.GamesProperties has to implemen properly INotifyPropertyChanged. Since you are using Caliburn, you probably want to derive it from PropertyChangedBase.