I have bound a DataGrid to a collection of data that contains several string properties. The view I am using is CompactCardView (or CardView) with HideEmptyCells set to True.
The problem I'm having is that properties returning null strings are not editable, the only way to make properties editable is to ensure they return a non-null string, either string.Empty or a non-empty string. However, doing this results in those properties being visible all the time (even when not in edit mode) and this is not desired as I have HideEmptyCells set to True for this reason.
When a record is edited, all the empty fields appear, so this implies that fields are supposed to be editable even though they are hidden while empty when not in edit mode. Is this a correct assumption, or is it purely to show to the user that there are some empty fields that are null and have no objects associated them to allow any change to take place?
Ideally, I would like HideEmptyCells to hide cells that contain non-null but empty string properties (i.e., return string.Empty or ""). Otherwise, I would like to be able to edit null fields.
I have attached an example project demonstrating this behaviour. In it, the elements in the bound collection each contain several properties demonstrating the effect that returning non-null and null strings has on the editable/hidden characteristics within the grid.
Could this please be investigated?
Many thanks in advance.
Jason
Associate, .NET Development
Morgan Stanley, UK