Forms
FormControlGenerate a validated form from your model, or lay one out by hand.
Overview
FormControl is a Blazor form that builds an editor for each property of your model, validates it with data annotations and reports every accepted value. Use it for settings, sign-up or leave-request forms without writing a field per property; when the layout matters, place the items yourself with groups, templates and tooltips. PropertyGridControl edits an object row by row, writing each change as it is made.
Examples
#Generated form
One line of markup, an editor for each of nine leave-request properties (the tenth, Id, is hidden with AutoGenerateField = false): clear Employee or enter 25 in Days to see the validation messages, then press Save.
Not saved yet.
#Hand-built form: group, template, tooltip, buttons
Lay out a hiring manager's request for Reservations agents yourself: a grouped fieldset, a templated openings stepper, a validation tooltip on "Name rules" and your own buttons.
Not sent. Last change: none.
#Property grid: edit an object
Edit an employee record directly; each change is written as it is made. Press Level as buttons to draw Level with your own editor through CustomEditor.
| Employee Id | |
| Name | |
| Office | |
| Vacation Days | |
| Training Budget | |
| Level | |
| Full Time | |
| Start Date |
EMP-0042: Luna Goodlove, Kyoto, Senior, 20 vacation days, started Mar 4, 2024, training budget 1200.00, full time. Changes reported: 0.