This is a migrated thread and some comments may be shown as answers.

[Solved] Grid Column for Complex Type

0 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rodrigo
Top achievements
Rank 1
Rodrigo asked on 06 Jul 2011, 10:48 PM
Hi,

i'm trying to bind a complex type to a column and it works fine. But, when i try to sort any column i received the message that a column with a complex type cannot be read.

Uncaught TypeError: Cannot read property 'NOM_GRUP_PROD' of undefined.
Look the column with the bound o.Enterprise.NOM_GRUP_PROD above:

My code:
@(Html.Telerik().Grid(Model)
        .Name("OrdersGrid")
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_GetList", "ApprovalPanel", new { enterpriseId = ViewBag.EnterpriseId, customerName = ViewBag.CustomerName, enterpriseGroupId = ViewBag.EnterpriseGroupId, unity = ViewBag.Unity, issueType = ViewBag.IssueType }))
        .Columns(columns =>
        {
          columns.Template((item) => @Html.IssueStatusImage((int)item.Status)).Title("Status");
          columns.Template((item) => @Html.ActionLink("Editar", "Edit", new { Id = item.Id })).Title("Editar");
          columns.Bound(o => o.DataSolicitacao).Title("Solicitado em");
          columns.Bound(o => o.NomeCliente).Title("Cliente");
          columns.Bound(o => o.Enterprise.NOM_GRUP_PROD).Title("Empreendimento");
          columns.Bound(o => o.NomeProduto).Title("Torre");
          columns.Bound(o => o.NomeUnidade).Title("Unidade");
        })
          .Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.NomeProduto)))
        .Groupable()
 
)

How can i solve this problem?

Thanks,
Lobo
Tags
Grid
Asked by
Rodrigo
Top achievements
Rank 1
Share this question
or