asp.net 枚举数据类型列的 MVC 4 网络网格排序问题



在MVC4 Web Grid中, I正在从服务器端绑定 Web 网格,以实现高效的分页和排序。排序适用于所有列,除了一列,即列的数据类型是 ENUM。

我已经尝试过使用这个站点中存在的 grid.bind() 示例,但不起作用。请帮助我

我遇到了同样的问题 - 它不会对枚举进行排序。所以我只是简单地称.当我将枚举添加到列表中时,我的枚举上的 ToString():

        private void CreateReport(int id, string name, 
          ReportType type, Relationshiplevel level, string date, string createdby,
                              string filetype, double filesize)
        {
          var newReport=new Report
            {
                Id = id,
              Name  = name,
              Reporttype = type.ToString(),
              Relationshiplevel = level.ToString(),
              CreatedDate = DateTime.Parse(date),
              CreatedBy = createdby,
              FileType = filetype,
              FileSize = filesize
            };
        _reports.Add(newReport);
       }

现在工作正常

最新更新