Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liviriniu opened this issue Apr 19, 2024 · 4 comments

Comments

@liviriniu
Copy link

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
Copy link
Member

exyi commented Apr 19, 2024

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Everywhere where we display nullable dates/datetimes with null text placeholder (like hyphen), <bp:GridViewDateTimeColumn is rendered useless because we have to resort to <bp:GridViewTextColumn as to make that placeholder happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants