We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I do a Custom Filter with column is Enum value?

Thread ID:





119569 Jul 9,2015 02:31 PM UTC Jul 10,2015 10:57 AM UTC ASP.NET MVC 1
Tags: Grid
Cristiano Souza Silva
Asked On July 9, 2015 02:31 PM UTC


I'm using MVC 5 + Knockoutjs.
I've a table named by ProductCategories, this one has a column named by Type (Int16). My enum define the value that column.

Now I need to create a custom column and it is necessary has a filter column, but I don't know how can I do that, because the information that show is a String (data annotation from enum) and my database has a Int16 column.

I tried to do, but doesn't work. When I perform a filter happen an exception.

{"Identifier 'TypeName' is not a parameter or variable or field of 'Sight.NoAlvo.TO.Entity.BasicForm.ProductCategory.ProductCategory'. If 'TypeName' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias."}

My solution:

public class ProductCategory : BaseEntity
        #region .: Properties :.
        public Int64 Id { get; set; }
        public String Name { get; set; }
        public Double MinimalValue { get; set; }
        public Int16 Type { get; set; }
        public String TypeName { get
                return ((EnumCategoryType)this.Type).GetNameIdentifier();


        public ActionResult KODataSource(DataManager clsDataManager)
            BaseResult<ProductCategory> clsData = ProductCategoryBusiness.GetAll(clsDataManager);

            ResultModel result = new ResultModel();

            result.result = clsData.Result;
            result.count = clsData.Count;

            return Json(result, JsonRequestBehavior.AllowGet);

$(function () {
            window.baseView = {
                dataSource: ej.DataManager({ url: '@Url.Action("KODataSource")', adaptor: "UrlAdaptor" }),
                column: [
                          { headerText: "Ações", template: true, templateID: '#CustomCommand', width: '10%' },
                          { field: "Name", headerText: "Nome" },
                          { field: "MinimalValue", headerText: "Valor mínimo", format: "R$ {0:n}" },
                          { field: "TypeName", headerText: "Tipo de Categoria" }, ]

Thank you.

Attachment: error_3dd33906.zip

Ragavee U S [Syncfusion]
Replied On July 10, 2015 10:57 AM UTC

Hi Cristiano,

We have analyzed the reported issue and also the screenshot that you have shared with us.

Based on the provided information, we have created a sample and we are sorry to let you know that we are unable to reproduce the issue mentioned at our end. The sample can be downloaded from the below location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/119569/ze/KoSample-635414846

Please try the sample and if you still face any difficulties, please get back to us with the below details.

1.       Screenshot of the exception
2.       Call Stack of the exception obtained
3.       Please reproduce the issue in the above provided sample.

Note: We suspect that you have shared the incorrect screenshot corresponding to the exception obtained. So please share the correct screenshot with us which will be very helpful for us to assist you accordingly.

Please get back to us if you need any further assistance.

Ragavee U S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon