We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Insert only one record

Hi,

I need to disable the add button when grid not is empty.



1 Reply

DM Dineshnarasimman Muthu Syncfusion Team March 23, 2023 05:44 PM UTC

Hi Pio,


Thanks for contacting Syncfusion Support.


Query: I need to disable the add button when grid is not empty.


We have analyzed your query about disabling the add button when the grid is not empty. We have achieved your requirement and we suggest you to use dataBound event and check the grid data length and set allowAdding as false. We have attached a sample code snippet for your reference.



    function dataBound()

    {

        if(grid.dataSource.length!=0)

        {

            grid.editSettings.allowAdding=false

        }

    }

 


Please let us know if you need any further assistance.


Regards,

Dineshnarasimman


Loader.
Up arrow icon