This is a migrated thread and some comments may be shown as answers.
The specified type member 'CustomModelProperty' is not supported
0 Answers 16 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jorge
Top achievements
Rank 2
Jorge asked on 24 Nov 2010, 06:02 AM
I am starting this new thread because the one I wrote before is for an old version.

I am currently using v2010.q3. I have a problem when using custom properties in my model and a linq source to feed the grid.

Seems the grid is using that properties to build the Linq query, but as they are custom, it crashes with
"The specified type member 'CustomModelProperty' is not supported..." etc.

Sample code: Add a custom property on the model, like

public partial class SIN_PROCESOENCUESTA
    {
        [ScaffoldColumn(false)]
        public string _Mes
        {
            get
            {
                return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthNamePRE_MES).Capitalize();
            }
        }
    }

The only workaround I found was to convert the query to a list on the controller, ie,

public class SIN_ProcesoEncuestaController : Controller
    {
        IndiceIndustriaEntities IIE = new IndiceIndustriaEntities();
  
        public ActionResult Admin()
        {            
            return View(IIE.SIN_PROCESOENCUESTA.ToList());            
        }
    }

If I don't, it crashes. It works fine for a small numbe of rows, but I lose the capability of dynamic Sql Filtering using the grid.

Any ideas or workarounds? Am I doing something wrong?

Tags
Grid
Asked by
Jorge
Top achievements
Rank 2
Share this question
or