Example #1
0
        public virtual Dictionary <string, string> GetFilterValues(DataTable dt)
        {
            var empty = "(Empty)";

            var dic = dt.AsEnumerable().Select(item => Convert.ToString(item[FieldName]))
                      .OrderBy(item => item).Distinct(StringComparer.InvariantCultureIgnoreCase)
                      .ToDictionary(item => item, item => string.IsNullOrEmpty(item) ? empty : DataViewUtils.TrimStringOverMaxLength(item));

            return(dic);
        }