문제

In MVC4 Web Grid, Iam binding Web Grid from server side for efficient paging and sorting. Sorting is working fine for all columns except one column i.e the datatype of column is ENUM.

I have tried with grid.bind() samples that are present in this site but not working. please help me

도움이 되었습니까?

해결책

I had the same problem - it would not sort the Enums. So I simply just called the .ToString() on my enums when I added it to a list:

        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);
       }

Works fine now

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top