Solved

Disabling Add Row Button on a Grid

  • 13 April 2023
  • 2 replies
  • 203 views

Userlevel 2
Badge

Supposed you have a form grid screen. Form at the top and grid beneath. The grid DAC is a child of the form DAC. How do I disable the standard add row button on the grid toolbar in parent Graph. [This may be based on some conditions or value from the parent DAC ]

icon

Best answer by Vignesh Ponnusamy 13 April 2023, 15:45

View original

2 replies

Userlevel 7
Badge +4

Hi @robert38,

In the RowSelected event you can set AllowInsert to false for the grid view. Below is an example that disables insert in the Sales Order screen,

 

    public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
    {
        #region Event Handlers

        protected void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (SOOrder)e.Row;
            //Condition as requried
            Base.Transactions.AllowInsert = false;
        }

}

 

Thanks, 

Hello @robert38,
Also you can add <Mode AllowAddNew="false"></Mode> to aspx inside px:Grid section where you want to disable add button. On screen it will look like this. But it’s better to use if you will never need this button

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved