microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.78k stars 363 forks source link

feat: DataGrid cell validation in FluentUI #1505

Closed BigBasti123 closed 8 months ago

BigBasti123 commented 8 months ago

🙋 Feature Request

The DataGrid on https://www.fluentui-blazor.net/DataGrid in "Template columns 2" allows editing a specific cell of the Grid. This is very useful and I used the feature a lot while developing WinForms Apps. What I am missing right now is the possibility to have the validation of a single cell.

🤔 Expected Behavior

When I type in a "wrong" value in terms of data validation to the cell there should be an error message in a WinForms type manner. That means a little red exclamation mark inside the cell and a red border around the cell. When you hover the red exclamation mark there should be a tooltip, describing the error. This should not interfere with the regular tooltip of the cell.

😯 Current Behavior

There is no way to show the cell validation in a graphical manner.

💁 Possible Solution

See the expected behavior.

🔦 Context

The Alternative is staying with WinForms.

💻 Examples

vnbaaij commented 8 months ago

While we do support basic editting capabilities in the DataGrid as shown in the exampl, we do not recommend/encourage to use that. FLuentDataGrid (based on QuickGrid) is primarily menat for showing/sorting/filtering data.

If you want to use it anyway, and you need validation, then you will need to make use of the standard Blazor functionalities for this (ie place your grind in an EditForm, use FluentValidationMessage to show errors and use System.ComponentModel.DataAnnotations; to define your data validation rules, etc). The grid has no specific capabilities for this.