Hello,
I want to use a custom validator to display tooltip errors in an edit dialog that is built from a template. I tried to follow your example where you build MyCustomValidator.cs ( https://blazor.syncfusion.com/documentation/datagrid/column-validation )
But the problem is that it expects a cascading parameter of EditForm and I am not using an edit form. My layout is like this:
<DataGrid>
<Validator>
<CustomValidator>
</Validator>
<Template>
</Template>
</DataGrid>
Is there a way to use Tooltip error display in a dialog built using a template that isn't an EditForm?
Hi Sheldon,
Greetings from Syncfusion support.
We have analyzed your query and we suggest you use the in-built validation tooltip to show
those error messages by using Validator TemplateContext.ShowValidationMessage(fieldname,
IsValid, Message)
method. We have already discussed this topic
in our UG documentation. Kindly refer to the attached document link for
your reference.
Reference link: https://blazor.syncfusion.com/documentation/datagrid/column-validation#display-validation-message-using-in-built-tooltip
Kindly get back to us if you have any further queries.
Regards,
Keerthana.
This is exactly the example I was following but it doesn't seem to work. The difference in my case is that I am using a Template in order to be able to edit fields that don't show in the grid. Take your example and use a Template instead and I think you will see the issue.
Thanks
Hi Sheldon,
Welcome from Syncfusion support.
We have analyzed your query and we would like to inform you that the data grid is a
templated blazor component that allows you to customize various parts of UI
using template parameters. It allows you to render the custom components or
content based on your own logic. Whereas validation cannot be performed in
Template. Kindly refer to the attached documentation for your reference.
Reference link: https://blazor.syncfusion.com/documentation/datagrid/templates
Kindly get back to us if you have any further queries.
Regards,
Keerthana.
Ah ok, so you are saying it's just not possible inside of a Template? Any alternative suggestions? I need to use <Template> because I am editing fields that are not in the grid.
Hi Sheldon,
Welcome from Syncfusion support.
We have analyzed your query, and we suggest you use the form validation to
display the validation message in the dialog template. We have discussed this similar
topic in our UG documentation. Kindly refer to the attached documentation for
your reference.
Reference link: https://blazor.syncfusion.com/documentation/datagrid/column-validation#display-validation-message-in-dialog-template
Kindly get back to us if you have any further queries.
Regards,
Keerthana.
This is what I am doing but i would like to show tooltips not errors piled at the top of the dialog.
Hi Sheldon,
Sorry for the delay and inconvenience caused.
We have analyzed your query and try to show tooltip validation within a dialog template. But it’s not possible to do within dialog template. We suggest you to do custom validation in default dialog editing or display validation message at top op the dialog. Kindly refer the attached sample and image for your reference.
|
|
Kindly get back to us if you have any further queries.
Regards,
Sarveswaran PK