riganti / dotvvm

Open source MVVM framework for Web Apps
https://www.dotvvm.com
Apache License 2.0
743 stars 97 forks source link

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

Open liviriniu opened 5 months ago

liviriniu commented 5 months ago

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.

exyi commented 5 months ago

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 :/

liviriniu commented 5 months ago

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 commented 5 months ago

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.