I have this view Listar.cshtml
@model IEnumerable<ODM>
@{
var idGrid = "grid" + this.ViewBag.IdParameters ?? string.Empty;
var grid = new IBM.Web.Helpers.WebGrid(id: idGrid, rowsPerPage: this.RowsPerPage, ajaxUpdateContainerId: idGrid);
var columns = new WebGridColumn[] {
grid.Column("Codigo", ODMResources.Codigo),
grid.Column("DataEmissao", ODMResources.DataEmissao),
**grid.Column("Iniciativa.Codigo"**,
canSort: false,
header: IniciativaResources.Titulo),
grid.Column("DescricaoChefes", ODMResources.ProjectChief),
grid.Column("Modelo.Codigo",
canSort: false,
header: ModeloResources.ModeloReferencia),
//grid.Column("DescricaoResponsaveis", ODMResources.ProjectResponsible),
grid.Column("Causal", ODMResources.Causal),
grid.Column("Estado", ODMResources.Estado),
}
@grid.GetHtmlExtended(this.Model, this.RowsCount, page: this, columns: columns)
Both Iniciativa.Codigo
and Modelo.Codigo
do not work. The error appears:
Column "Initiative.Code" does not exist.
What is the best way to call the description of a column of another class in the WebGrid?
Note: Initiative and Model has an MDG relationship.