Reputation: 6450
I have a weird situation in one of my program when a datagrid's content is not update when I call the grid.items.refresh command.
I do know that the source of the grid is updated as it should and should I quit the windows and reopen it, which has the effect of giving the itemssource back to the datagrid, the grid is now OK.
Are there any known bug with the items.refresh command of the datagrid or is there something I am not doing right ?
Thanks,
Edit : Forgot to mention, this only seems to happen on my client computer. As usual, it's working here, but I did see the problem myself. I just can't explain it.
Upvotes: 1
Views: 1243
Reputation: 4122
Some suggestions:
On your DataGrid column definitions, you can add UpdateSourceTrigger=PropertyChanged
to your Column Bindings.
ie: Binding="{Binding Path=Product.ProductCode, UpdateSourceTrigger=PropertyChanged}"
If that does not help, consider changing your List to an ObservableCollection<OfSomething>
. Then WPF's data binding will automatically react to changes within your source.
Upvotes: 3