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

Kendo grid

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ALLAN
Top achievements
Rank 1
ALLAN asked on 09 May 2020, 03:23 PM

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))
)

            )

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 May 2020, 01:51 PM

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.
Tags
Grid
Asked by
ALLAN
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or