Kendo grid

2 posts, 0 answers
  1. ALLAN
    ALLAN avatar
    1 posts
    Member since:
    May 2020

    Posted 09 May 2020 Link to this post

    Bom dia, eu tenho uma grid dentro de um popup, esse popup recebe uma model com 5 propriedades e uma lista "opcoes". Eu gostaria de saber como populo essa grid com essa lista da model. Tentei conforme o codigo abaixo, mas sem sucesso.

     

            @(Html.Kendo().Grid<Entidades.OpcaoPerguntas>(Model.Opcoes)
                .Name("gridOpcao")
                .Columns(columns =>
                {
                    columns.Bound(o => o.CodigoOpcao).Visible(false);
                    columns.Bound(o => o.Ordem).Visible(false);
                    columns.Bound(o => o.DescricaoOpcao).Title("Descrição da Opção");
                    columns.Bound(o => o.DescricaoDivisor).Title("Divisor");
                    columns.Bound(o => o.DescricaoTipoOpcao).Title("Tipo de Opção");
                    columns.Bound(o => o.Meta);
                    columns.Bound(o => o.Pontos);
                })
                .Sortable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Batch(true)
                    .ServerOperation(false)
                    .Model(m => m.Id(i => i.CodigoOpcao))
    )

                )

  2. Nikolay
    Admin
    Nikolay  avatar
    324 posts

    Posted 12 May 2020 Link to this post

    Hello Allan,

    I am posting this in English as it is the only language that is currently supported.

    When the Grid is initialized in a window it needs to be resized according to the dimensions of its container. Here the activate event can be used. This is demonstrated in the following article. Please note it uses a jQuery grid implementation, however, the logic remains valid for MVC Grids.

    Let me know if this answers your questions.

    Regards,
    Nikolay
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top