Skip to main content

Hide Columns from Grid on the Fly

  • 27 September 2022
  • 0 replies
  • 518 views

Hi everyone,

I want to share with you how my team has conditionally hide a Grid Column in an Acumatica Grid.

Firstable, the context is that we wanted to hide the Quota % column of a grid when the Use Quota Flag of the header was set to No.

To do so:

1) Code in the RowSelected of the Grid (Not the parent) the field property SetVisible:
 

PXUIFieldAttriute.SetVisible<DAC.Field>(cache, null, Conditional_Expression);

2) Traditionally the Acumatica Event_Handlers are coded by adding

if(e.Row == null)
return;

You must put the code block from 1) before 2) as it is depicted in the following image
 

Event Handler Definition Example
  1. You must add the CommitChanges propperty to the fied triggering the condition. In our case, the Use Quota field
  2. I´m sharing the grid propperties, nothing special at all
    Grid Definition

    Result
    -Before
     



    -After
     

     

Be the first to reply!

Reply