How can hide the Data Form button?

I'd like to use a toolbar for the save functionality and would like to hide the form button. How can I do this?


2 Replies

KP Kokila Poovendran Syncfusion Team August 21, 2024 11:58 AM UTC

Hi Shawn Davis,


Thank you for your inquiry.


To hide the buttons in the SfDataForm component, you can simply customize the FormButtons section by leaving it empty. This will prevent any buttons from being rendered within the form, allowing you to use a toolbar or any other custom component for the save functionality.


Here’s how you can do it:


<SfDataForm EditContext="@RegistrationEditContext">

    <FormValidator>
        <DataAnnotationsValidator></DataAnnotationsValidator>
    </FormValidator>

    <FormItems>
        <FormAutoGenerateItems></FormAutoGenerateItems>
    </FormItems>

    <FormButtons>
    <!-- You can empty the forms buttons here-->
    </FormButtons>

</SfDataForm>



In this example, the FormButtons section is intentionally left empty, which effectively hides the default buttons provided by the SfDataForm.


You can check out this interactive sample to see how this works in a live environment.


For more details on customizing the layout of the SfDataForm, please refer to the documentation here.





Let us know if you need any further assistance.



SD Shawn Davis August 21, 2024 08:44 PM UTC

Well that was too simple. Thank you very much!


Loader.
Up arrow icon