I am dynamically loading a small amount of data from a Sql Server table using the dynamic data row concept in this example.
Everything is working however if one of the values is DBNull then when the column is sorted the grid displays as blank. Toggling the sort back to off shows the data again.
To solve this I am simply casting to null when the value is DBNull.
var value = reader.GetValue(x);
row[column] = value == DBNull.Value
?
null
: value;
This sounds to me like a bug.