View Full Version : I have a problem with ModelField

Sep 03, 2020, 6:26 PM
I am new to Ext.Net. I setup everything as the guide but I created a view, added a sample MVC code sample and I get an error of
'The type or namespace 'ModelField' could not be found(are you missing a using directive or an assembly reference?)'.

@using Ext.Net.HtmlHelpers
@using Ext.Net.Core

@section headtag{

@section home
<h1>Simple Array Grid</h1>

.Title("Cell commands")
new ModelField("company"),
new ModelField("price", ModelFieldType.Float),
new ModelField("change", ModelFieldType.Float),
new ModelField("pctChange", ModelFieldType.Float)
Html.X().DateColumn().Text("Last Updated").DataIndex("lastChange")

Sep 10, 2020, 5:19 AM
Hello @HenrySseki, and welcome to Ext.NET forums!

Ext.NET 7 is currently in a stage where syntax may change dramatically between versions (that's why we don't call it beta yet). So perhaps the guide you used (you didn't link which guide you're talking about) no longer matches the syntax for model fields. Your best bet is to just trust IntelliSense as it will point you what is accepted within the .Model().Fields() context.

You probably want something like this:

new DataField() { Name = "company" },
new NumberDataField() { Name = "price"),
new NumberDataField() { Name = "change"),
new NumberDataField() { Name = "pctChange")

Hope this helps!