I have a Header / Detail custom screen where I\'m manipulating which grid columns display based on a dropdown selection in the header. This works fine, but now I\'d like to
You can refer below example to dynamically change Grid Column Header.
Below example works with Screen PM401000 – Project Transactions Inquiry
public class TransactionInquiryExt : PXGraphExtension<TransactionInquiry>
{
public void TranFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseInvoke)
{
if (baseInvoke != null)
baseInvoke(cache, e);
PX.Objects.PM.TransactionInquiry.TranFilter row = e.Row as PX.Objects.PM.TransactionInquiry.TranFilter;
if (row == null) return;
PXUIFieldAttribute.SetDisplayName<PMTran.description>(Base.Transactions.Cache,
row.ProjectID.HasValue ? "Description for Project Tran" : "Description");
}
}
Make sure to set RepaitColumns
property to True of PXGrid
Control.
Your display name routine looks correct however to make sure the column names actually update you need to do the following: