No model fields available on MVC DevExpress Extension insert

By | 25. April 2017

If you are just starting to experiment with MVC and DevExpress then it might happen that for your surprise you can not see model class fields in Extension insert wizard screen. First thing to do is ensure that project has been rebuilt rebuilt before using wizard. Second thing to do is check that Module class properties have defined get and set methods .

Simple example.

Let’s create class

namespace DXWebApplication1.Models
{
    public class CarModel
    {
        public int Id;
        public string Manufacturer;
        public string Model;
        public int Year;
    }
}

Now when trying to add DevExpress GridView to View, we can not finish the wizard task as no columns are available.

no columns

 

Let’s change the model class a bit.

namespace DXWebApplication1.Models
{
    public class CarModel
    {
        public int Id { get; set; }
        public string Manufacturer { get; set; }
        public string Model { get; set; }
        public int Year { get; set; }
    }
}

And MVC DevExpress Extension wizard will look like this :

columns available

 

Mission completed, happy coding!

 

Leave a Reply