DataGrid errors when amount is greater than page size

Hello @Team

There is this one grid that is giving me headaches. It's populated with a list of the following object:

public class Error {
    public Error() { }
    public Error(Exception exception) {
        dateTime = DateTime.Now;
        message = exception.Message;
        stackTrace = exception.StackTrace;
        innerMessage = exception.InnerException?.Message;
    }
    public DateTime dateTime { get; set; }
    public string message { get; set; }
    public string stackTrace { get; set; }
    public string innerMessage { get; set; }
}

Here's the DataGrid in the designer (notice the PageSize property):


This is how the data is loaded:

An error is thrown when ordering any of the columns:

Filtering also throws an error:

This does not happen if I only take 15 or less items from the list:


Hi @kim,

In my opinion one of the items in the collection bound to the grid is null:

1 Like

You are absolutely right, thanks!
image