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 ]
Solved
Disabling Add Row Button on a Grid
Best answer by Vignesh Ponnusamy
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,
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.