Do you even need to create a presentation model? Can't you just populate a local DataTable and bind a DataGrid to it? There are a lot of functions baked in ADO objects, and the DataGrid interacts with a lot of it. If you really need additional properties in the DataRow (for example, commands, for example), you can subclass DataTable and DataRow and add them. This can save you a lot of work.
Whether you are creating a DataTable or creating your own class, a fairly simple approach is to set AutoGenerateColumns to true and handle the DataGrid.AutoGeneratingColumn . You can intercept the list of columns that you want to hide, and then set e.Cancel to true when the generated column is in this list. The documentation shows an example of how this looks.
source share