Skip to main content
Solved

Disabling Add Row Button on a Grid


Forum|alt.badge.img

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 ]

Best answer by Vignesh Ponnusamy

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, 

View original
Did this topic help you find an answer to your question?

2 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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, 


Forum|alt.badge.img

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings