Thursday, January 26, 2012

Hide Fields in a AxGroup /AxForm in Enterprise portal

There was a requirement to hide/un-hide the fields within AXGroup according to the setup defined in AX form either to show fields or not as per user.

protected void AxFrmEmployee_PreRender(object sender, EventArgs e)
{
    AxForm frm = this.axFrmEmployee;
   
    for (int i = 0; i < this.AxGroup1.Fields.Count; i++)
    {
        AxBoundField fld = this.AxGroup1.Fields[i] as AxBoundField;
        if ((fld != null) && (fld.Metadata.Name == "TitleId"))
        {
            fld.Visible = (frm.CurrentMode == DetailsViewMode.ReadOnly) ? false : true;
        }
    }
}

No comments:

Post a Comment

I will appreciate your comments !

How to enable new Microsoft teams - Public Preview!

New Microsoft Teams is just AWESOME, quick but useful post below shows how you have this preview feature to make your life EASY!  Open Micr...