This is a migrated thread and some comments may be shown as answers.

[Solved] Problem when using enum filter

1 Answer 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Renato
Top achievements
Rank 1
Renato asked on 15 Jun 2012, 01:21 PM
Hi all.
I've updated recentry telerik MVC3 to Q2 version.
The problemn is, one of grid columns is a Enum, when i filter by this column an error occurs:
Exception: -The specified value is not an instance of type 'Edm.Int32' Parameter name: value.
I'm using Entity Framework 4.1, in the controller i'm returning  an IQueryable.

My Enum is:
 public enum OrderEnum<br> {<br>        [DisplayAttribute(Name = "Sucesso")]<br>        Success = 0,<br>        [DisplayAttribute(Name = "Informações Básicas")]<br>        BasicInformation = 1<br> }


Controller:
[GridAction()]<br>        public ActionResult OrderGrid()<br>        {<br>IQueryable<OrderVO> query =  OrderRepositoryView.Orders<br>                    .OrderBy(o => o.NrOrder)<br>                    .Select(o => new OrderVO<br>                    {<br>                        Id = o.Id,<br>..<br>..<br>                        ProcessStatus = (OrderEnum)o.ProcessStatus<br>                    }).AsQueryable<OrderVO>();<br>return View(new GridModel(query));<br>}<br>

Any Solution for this problem?

Thanks

1 Answer, 1 is accepted

Sort by
0
Fernando
Top achievements
Rank 1
answered on 22 Jun 2012, 05:54 PM
Hello!
I'm having the same problem.

I have a grid with an enum filter and when try to filter with column with enum, I'm getting the same exception!

Renato, have you already solved the problem?

Ps: I'm using EntityFramework 4.3.1 and Telerik Asp Mvc Q2 (latest version)

Thank You Very Much!

Best regards,

Fernando.
Tags
Grid
Asked by
Renato
Top achievements
Rank 1
Answers by
Fernando
Top achievements
Rank 1
Share this question
or