I can't get Model reference table value in View

  1. #1

    I can't get Model reference table value in View

    This is my Model public partial class Gamer
    {
    public int Id { get; set; }
    public string Name { get; set; }
    public string Gender { get; set; }
    public string City { get; set; }
    [DateColumn]
    public Nullable<System.DateTime> DateOfBirth { get; set; }
    public Nullable<int> TeamId { get; set; }

    public virtual Team Team { get; set; }
    }
    This is my View
    @(Html.X().GridPanel()
    .ID("gpGamers")
    .Title("Gamers")
    .Icon(Icon.Table)
    .Frame(true)
    .Width(600)
    .Height(300)
    .Store(Html.X().StoreForModel().ID("stGamers"))
    .ColumnModel(
    Html.X().ColumnFor(Model, m => m.Name)
    .ToBuilder<Column.Builder>()
    .Width(100)
    .Text("Name"),
    Html.X().ColumnFor(Model, gamer => [COLOR=#ff0000]gamer.Team.Name)[/COLOR] .ToBuilder<Column.Builder>()
    .Width(100)
    )
    )

    Why I can't get gamer.Team.Name value?
  2. #2
    Hello! And welcome to Ext.NET forums!

    Please wrap your code blocks within [code][/code] tags. Also, it does not look like your test case is runnable on our side; for that end, please review our guidelines that should help you providing a fully runnable code sample:

    - Tips for creating simplified code samples
    - More Information Required
    - Forum Guidelines
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 9
    Last Post: Sep 29, 2014, 2:55 PM
  2. Replies: 1
    Last Post: Jul 30, 2013, 3:36 PM
  3. [CLOSED] Loading a partial view in Table Format
    By pawangyanwali in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 23, 2012, 12:44 PM
  4. Replies: 4
    Last Post: Feb 21, 2012, 4:23 AM
  5. Using model var in mvc view
    By sinai.doron in forum 1.x Help
    Replies: 1
    Last Post: Nov 09, 2011, 5:19 PM

Posting Permissions