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

Prevent initial request when grid is empty

1 Answer 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emmsa
Top achievements
Rank 2
Emmsa asked on 06 Jul 2017, 03:08 PM

Hi,

I'm binding a grid to a collection of my model and when that collection is empty the grid is making a post to get data.

Trying to avoid that useless ajax requests I set AutoBind(false) but when I return a collection with data the grid do not bind it.

How can I prevent the request event if there is no initial data?

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 11 Jul 2017, 06:22 AM
Hello Emmsa,

Based on the provided information I assume that you are using both server and ajax binding. Using both server and ajax binding might lead to unexpected behavior. In other words if you are binding the grid to a collection of your model, the binding is done on the server and the grid is sent to the client populated with data, so no additional requests are needed.

I recommend you to take a look at the following demo, which illustrates how to bind the Kendo Grid server-side:


Notice that dataSource is not specified, since the grid is bound to its data on the server.

If this is not your case, please send sample where the issue occurs, so I can investigate locally your exact case and help you more efficiently.


Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular 2 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
Emmsa
Top achievements
Rank 2
Answers by
Georgi
Telerik team
Share this question
or