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

How to populate the data in grid on the client

1 Answer 377 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Мавричев
Top achievements
Rank 1
Мавричев asked on 27 Apr 2018, 01:58 PM

Hello.

There is a grid in PartialView:

@(Html.Kendo().Grid(Model.SpokesmanList)
      .Name("grid1")
      .Columns(columns =>
      {
            columns.Bound(p => p.LastName);
            columns.Bound(p => p.DocumentType);
            columns.Bound(p => p.Position);
      })
    )

 

How can I fill this table with data on the client by calling the javascript function without serverside requests?

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 May 2018, 06:00 AM
Hello, Мавричев,

Thank you for the details.

The desired result can be achieved using the data method of the Grid dataSource instance. This will require passing the data array to be passed to the data method and the Grid will be populated:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/data3

$('#grid1').data('kendoGrid').dataSource.data(newData)

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Мавричев
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or