I have a DataGrid
where the ItemsSource
is bound to an ObservableCollection<LogEntry>
in the ViewModel. In the DataGrid
the properties Message
and Date
from the LogEntry
-class are displayed.
The items in this ItemsSource
are changing very often depending on an outer selection.
Now I want to introduce an additional column in my DataGrid
which displays the row-number.
Is there a simple way to do this in WPF with MVVM or do I have to create a new class (e.g. RowLogEntry
) which inherits from LogEntry
and provides a property for the row-number?