public static bool TryDetermineSortType(DataScreenBase dataScreen, string field, out SortType sortType)
        {
            if (IsFinPeriod(dataScreen, field))
            {
                sortType = SortType.ByValue;
                return(true);
            }

            sortType = SortType.ByDisplayValue;
            return(false);
        }
        public static bool IsFinPeriod(DataScreenBase dataScreen, string field)
        {
            if (!String.IsNullOrEmpty(field))
            {
                var attr = dataScreen?.View.Cache
                           .GetAttributesReadonly(field, true)
                           .OfType <FinPeriodIDFormattingAttribute>()
                           .FirstOrDefault();

                if (attr != null)
                {
                    return(true);
                }
            }

            return(false);
        }