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 ]
Hi
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 Handlersprotected 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
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
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.