Validating when all datagrid rows editable

Hi team. I have a datagrid where I wanted all rows to always be in edit mode. As per a previous suggestion from you in this forum, to achieve this I put all columns inside Template tags rather than EditTemplate tags, and this works very well except that any validation tags are not triggered, and the EditContext.Validate feature will not work in this case.

Can you suggest a way I can get the validation to work in this situation? Or, is there a way to revert to using EditTemplates but have every row of a datagrid go into edit mode at opening?

KR
Reg

Validation with Template will not work. As far as I remember we provided an example with EditTemplate and all rows editable + validation.


Thanks for this @enchev. For anyone else using this, as I wanted all rows to go into Edit mode without the need for the user to click a button (as in this example), I used the page's OnAfterRenderAsync event to run the code that the demo button does.

Cheers
Reg

Hi again. The demo that comes up for me does not have the Edit All Rows button?

KR
Reg

You can add such with the code from my screenshot.

Yes, although I did want to look at some of the other code, but never mind.

One follow up on this, please. Is there a way, in c#, to see if a datagrid is currently showing any errors? I need to programmatically know if every modified row has passed its validation checks.

I've tried using grid.IsValid, I get a compiler error message...

In this case you are not using latest version of Radzen.Blazor.

Ok, that sorted it, and the grid.IsValid is perfect for my needs.

Many thanks @enchev