dotvvm icon indicating copy to clipboard operation
dotvvm copied to clipboard

Add to GridView columns the equivalent of `NullDisplayText` property from WebForms

Open liviriniu opened this issue 10 months ago • 3 comments

Please implement NullDisplayText from WebForms into the columns of the GridView control of DotVVM (Business Pack included) because it is highly needed to avoid a lot of text handling of null values in code-behind.

The NullDisplayText is expected to simply replace with a given text (hardcoded or bound) a null value of the main bound value to the column.

liviriniu avatar Apr 19 '24 16:04 liviriniu

Thanks for the suggestion. I'm not sure how exactly would this property interact with inline editing - would you want it to also apply to the textbox, or only to the plain text literal? I'm also afraid, this is less easy than it might seem to implement correctly on our side :/

exyi avatar Apr 19 '24 19:04 exyi

This would be ideal to apply to all states of the grid, including to the add/edit textbox if that is what your are referring to.

In our case, <bp:GridViewTextColumn and <bp:GridViewDateTimeColumn are the most used types of columns that need null treatment like replaced with Em dash or a custom placeholder or empty string

liviriniu avatar Apr 20 '24 08:04 liviriniu

PS: also, a <bp:GridViewDateOnlyColumn would be nice as the more recent .NET has the loooong awaited DateOnly type which we heavily use. But this is another story.

liviriniu avatar Apr 20 '24 08:04 liviriniu