public virtual IEnumerable captions()
        {
            INSetupExt setupExt = Base.insetup.Current.GetExtension <INSetupExt>();

            AttributeCaptions row = new AttributeCaptions();

            foreach (CSAttributeDetail2 detail in this.AttributeDetails.Select(setupExt.UsrCategoryAttribute))
            {
                switch (detail.SortOrder)
                {
                case 1:
                    row.Caption1 = detail.Description;
                    break;

                case 2:
                    row.Caption2 = detail.Description;
                    break;

                case 3:
                    row.Caption3 = detail.Description;
                    break;

                case 4:
                    row.Caption4 = detail.Description;
                    break;

                case 5:
                    row.Caption5 = detail.Description;
                    break;

                case 6:
                    row.Caption6 = detail.Description;
                    break;

                case 7:
                    row.Caption7 = detail.Description;
                    break;

                case 8:
                    row.Caption8 = detail.Description;
                    break;

                case 9:
                    row.Caption9 = detail.Description;
                    break;
                }
            }

            yield return(row);
        }
        protected virtual void AttributeCaptions_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            AttributeCaptions row = (AttributeCaptions)e.Row;

            if (row == null)
            {
                return;
            }

            INSetupExt setupExt = Base.insetup.Current.GetExtension <INSetupExt>();

            this.Attributes1.AllowSelect = false;
            this.Attributes2.AllowSelect = false;
            this.Attributes3.AllowSelect = false;
            this.Attributes4.AllowSelect = false;
            this.Attributes5.AllowSelect = false;
            this.Attributes6.AllowSelect = false;
            this.Attributes7.AllowSelect = false;
            this.Attributes8.AllowSelect = false;
            this.Attributes9.AllowSelect = false;

            foreach (CSAttributeDetail2 detail in this.AttributeDetails.Select(setupExt.UsrCategoryAttribute))
            {
                switch (detail.SortOrder)
                {
                case 1:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption1>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes1.AllowSelect = true;
                    break;

                case 2:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption2>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes2.AllowSelect = true;
                    break;

                case 3:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption3>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes3.AllowSelect = true;
                    break;

                case 4:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption4>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes4.AllowSelect = true;
                    break;

                case 5:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption5>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes5.AllowSelect = true;
                    break;

                case 6:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption6>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes6.AllowSelect = true;
                    break;

                case 7:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption7>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes7.AllowSelect = true;
                    break;

                case 8:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption8>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes8.AllowSelect = true;
                    break;

                case 9:
                    PXUIFieldAttribute.SetVisible <AttributeCaptions.caption9>(Base.Caches[typeof(AttributeCaptions)], null, true);
                    this.Attributes8.AllowSelect = true;
                    break;
                }
            }
        }