Having a ReadOnly Property directly on FormItem
It would be nice to have a ReadOnly Property directly on FormItem, instead to have a template with an eg. SfTextBox readonly=true
I don't understand why there is an "IsEnabled" and not a "IsReadOnly"
The purpose is the same (don't allow to fill the data by the user), but the IsEnabled maked the form aestetically ugly with the grey fields (imho)
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
MR
Mallesh Ravi Chandran
Syncfusion Team
November 17, 2025 12:46 PM UTC
Currently, there is no
ReadOnly property available directly on the FormItem container in DataForm. Instead, the ReadOnly property can be applied to the individual input components within the FormItem, such as TextBox, NumericTextBox, or similar controls.IsEnabled - Works globally because disabling is consistent across all controls.ReadOnly - Component-specific because not all controls support or interpret "read-only" the same way.Form Items only supports - https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataForm.FormItem.html#properties
When using
IsEnabled, as it applies a default disabled style that may look greyed out. If you prefer to keep the original look while preventing user interaction, you can override these styles using CSS. For example:.e-form-item-wrapper .e-input-group.e-control-wrapper.e-disabled { opacity: 1; /* Keep normal opacity */ color: #000; /* Text color */ background-color: #fff !important; /* Background color */ pointer-events: none; /* Prevent interaction */ } |
Sample : https://blazorplayground.syncfusion.com/embed/hNroCsMwpzlSKOWT?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
This approach allows you to maintain the aesthetic while disabling input.
This approach allows you to maintain the aesthetic while disabling input.
For a direct support read-only behavior, we recommend using the template option to render individual components (e.g., TextBox, NumericTextBox) and set their ReadOnly property.
Documentation reference : https://blazor.syncfusion.com/documentation/data-form/templates
Marked as answer
SR
Sandro Rizzetto
November 18, 2025 07:30 AM UTC
Thanks, make sense that not all controls (eg. select list) supports readonly
Thanks a lot for the css "trick"
MR
Mallesh Ravi Chandran
Syncfusion Team
November 19, 2025 07:31 AM UTC
Sandro Rizzetto, Thank you for the update. Please let us know if you require further assistance.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
SR Sandro Rizzetto
- Nov 16, 2025 11:24 AM UTC
- Nov 19, 2025 07:31 AM UTC