The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Is there a way to hide or show form items in data form depending on the selected value in a dropdown list? The dropdown list is also part of the data form.
UDUdhayaKumar Duraisamy Syncfusion Team January 28, 2025 05:16 PM UTC
To dynamically hide or show Form items in theDataForm component based on the value selected in a Dropdown List, you can utilizeForm Items,Templates, andconditional rendering.
Conditional Rendering: Use conditional statements (likeif or@if in Blazor) to determine which form items should be displayed based on the selected value in the dropdown list.
Templates: You can leverage templates for further customization of the form items.
Custom Validation: If the dynamically rendered form items require validation, you can implement custom validation to ensure proper functionality.
For detailed implementation steps, please refer to the following resources:
Thank you for your response. But how can you call the form items in the code section to setup custom validation?
I see some examples using EditForm but i don't see demos for Syncfusion's data form.
YVYaswin Vikhaash Rajaretenam Syncfusion Team February 3, 2025 01:31 PM UTC
Hi Eunice Ariola,
Thank you for reaching out. We have validated your query and found a solution. Custom validation in Syncfusion Blazor DataForm allows you to define your own validation rules by creating a custom ValidationAttribute and applying it to form fields.
For detailed instructions and an example, please refer to the documentation and sample provided below.