Datagrid bound to observable collection not updating beyond first item in collection #17170
Unanswered
reelthymeos
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a datagrid that is bound to an ObservableCollection (of a custom class called 'Step'). The collection starts out with no content, but when I press a button to add a row, it fires a command to add an instance of 'Step' to the collection, the dataGrid correctly shows that first row and allows me to edit it.
The problem is that subsequently added rows are never displayed in the DataGrid, it only shows that original row that was added. So if I keep hitting my "add step" button, which results in an instance of 'Step' being added to the observable collection, it doesn't show in the UI. Any idea of what might be going on here?
Here is a snippet of the XAML for the dataGrid:
And here is how the collection is setup in the ViewModel (this approach was taken from the Avalonia example for DataGrids) :
Beta Was this translation helpful? Give feedback.
All reactions