Thursday, June 19, 2014

Show / hide fields in AXgroup / grid in Enterprise portal

How to enable\ disable fields in Grid

foreach (DataControlField dcf in this.AxGroup_ExpenseHeaderOverviewLeft.DataControlFieldCollection)
            {
                axbf = dcf as AxBoundField;
                if (axbf != null)
                {
                    switch (axbf.DataField)
                    {
                        case "ExpNumber":
                        case "employeeName**":
                        case "Txt1":
                            axbf.Visible = true;
                            break;
                    }
                }
            }

How to enable\ disable fields in Group
            foreach (DataControlField dcf in this.AxGroup_ExpenseHeaderOverviewRight.DataControlFieldCollection)
            {
                axbf = dcf as AxBoundField;
                if (axbf != null)
                {
                    switch (axbf.DataField)
                    {
                        case "TrvRequisition!RequisitionNumber":
                        case "totalAmountAuthorized**":
                        case "totalApprovalAmountWithCurrencyCode**":
                            axbf.Visible = true;
                            break;

                        // Description is shown on right group during create, and on left group for Approver, for UX reasons
                        case "Txt1":
                            axbf.Visible = false;
                            break;
                    }
                }
            } 

No comments:

Post a Comment