I am trying to use the form control as a read only output of my model. How can I set the form to read only and get rid of the submit button?
2 Answers, 1 is accepted
0
Accepted
Marin Bratanov
Telerik team
answered on 25 Feb 2021, 07:54 PM
Hello David,
That sounds like a scenario for something like a PropertyGrid. You should Follow the implementation of such a component here (your Vote is already in).
The Form is explicitly an Edit component, it is designed for taking user input and letting the application use it.
Nevertheless, our next version will use the [Editable] data annotation attribute, so you could mark your model fields with [Editable(false)] so the editors (input) the Form renders will be disabled, but that is still not what the form is for, and might not even be feasible for your model.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Add an empty <FormButtons> element to the root for, like so:
<TelerikForm>
... Items code ...
<FormButtons>
@* Intentionally blank: FormButtons - RenderFragment - allows you to add custom buttons to the Form.
You can use the FormButtons tag to add a Clear button to the Form. If the FormButtons tag is
defined there will be no default buttons in the Form. *@
</FormButtons>
</TelerikForm>